batch programming ignore date and find new -
how can if variable %paaa% not equal %%u ( %%u showed in code) ignore nearest date, , find next?
for /f "tokens=1,2,3 delims=-" %%a in ("%current-date%") ( set comparable_date=%%a!%%b!%%c ) rem echo %comparable_date% set /a nearest_date=99999999 /f "tokens=1,2,3 delims=. " %%a in (%file_path%) ( set /a possible_nearest_date=%%c%%b%%a set /a old_result=!nearest_date!-comparable_date set /a new_result=!possible_nearest_date!-comparable_date if !new_result! lss !old_result! set /a nearest_date=!possible_nearest_date! ) if !nearest_date! equ 99999999 echo wrong file>&2 && endlocal && exit /b 3 set nearest_date=!nearest_date:~-2!.!nearest_date:~4,2!.!nearest_date:~0,4! color 4e echo( echo( rem type %file_path% /f "tokens=1,2* delims=()" %%l in ('type %file_path%^|find "!nearest_date!"') ( /f "tokens=1,2" %%t in ("%%l") ( echo neste prove: (!nearest_date!^) echo fag: %%u title %%u !nearest_date! grunder: %auth% echo tema: %%m^ ) ) ) echo( echo(
Comments
Post a Comment