|I have one file named list.txt which content is in the general form|
and so on….
The first token of each line is a date in the layout “dd/mm/yyyy”;
now I want to extract the corresponding line of today’s date and output result in a new file called today_list.txt
This is my attempt
@echo off > today_list.txt & setLocal enabledelayedexpansion
:: this is to set today’s date in a variable %today%
:: it’s fine in my case (because it’s dependent on user date layout)
for /f "tokens=1 delims=" %%a in ('date/t') do set today=%%a
:: but this is not ok because at this point I’ve lost the content of the variable %today%
for /f "tokens=1* delims=;" %%a in ('find "%today%" ^<list.txt') do (
I can imagine the problem has to do with the proper storing of the variable inside the for loop but I can not work out any solution…(may be something related to the use of the exclamation points with variables??)
Any help for this?