How to display a date sorted list of images with date field
I've written this batch file to list images by date, it runs slow and relies on the gnu unix utilities. I was wondering if there was a faster way to do this
@echo off
rem batch file # ==========================================================
rem Name...........: getimagebyage.bat
rem Description ...: List images by age
rem Parameters ....:
rem %1 - filter
rem Returns .......:
rem Author .......: Thomas Bodine
rem Modified.......:
rem Remarks .......:
rem ======================================================================
if not exist output md output
nova image-list > output/images.txt
set target=output/images.txt
if [%1] == [] goto :nofilter
grep -i %1 output/images.txt > output/imageFiltered.txt
set target=output/imageFiltered.txt
:nofilter
cut -c42-98 %target% > output/imageNames.txt
C:\Windows\System32\find.exe /v "-----" output/imageNames.txt > output/justNames.txt 2> NUL:
del /q output\imageage.txt
for /f "tokens=*" %%A in (output\justNames.txt) do call :getage %%A
sort output/imageage.txt > output/sortedImageAge.txt
start "" C:\Windows\System32\notepad.exe output/sortedImageAge.txt
goto :EOF
:getage
rem echo on
if [%1]==[] goto :EOF
if [%1]==[----------] goto :EOF
if [%1]==[Name] goto :EOF
set imageName=%*
glance image-show "%imageName%" > output\imageinfo.txt
perl -n -e "print $1,' ',""%imageName%\r\n"" if (/updated.*(\s\d\d\S+)/)" output\imageinfo.txt
perl -n -e "print $1,' ',""%imageName%\r\n"" if (/updated.*(\s\d\d\S+)/)" output\imageinfo.txt >> output\imageage.txt
@echo off
goto :EOF
:EOF
Thanks for your time and attention.