Dear Experts,
How to do this,
if token no 6 in abc.txt is LEQ current time, do echo %%a %%b %%c %%d %%e %%f %%g >> output.txt
abc.txt is =
abc.tre 0 W131738 Nov 16 12:00:57 2009
sfsdf.sdfsdf 0 W131455 Nov 16 10:02:11 2009
fsdf.rty 0 W7F0BCU182 Nov 16 11:02:12 2009
qw.qwe 2 w4059 Nov 16 09:05:38 2009
wsx.rfv 2 W0132017 Nov 16 05:06:13 2009
xdr.cft 0 W0132017 Nov 16 07:06:33 2009
tgb.ikm 2 W0131738 Nov 16 12:15:01 2009
if current time is 11:00:00
Output.txt should have,
sfsdf.sdfsdf 0 W131455 Nov 16 10:02:11 2009
qw.qwe 2 w4059 Nov 16 09:05:38 2009
wsx.rfv 2 W0132017 Nov 16 05:06:13 2009
xdr.cft 0 W0132017 Nov 16 07:06:33 2009
This is what i have tried,
but the output.txt is just showing %i %j %k %l %m %n %o
cd\
set Ct=%time%
set Ctt=%Ct:~0,2%
for /f "tokens=6" %%i in (abc.txt) do set LD=%%i
set LDD=%LD:~0,2%
if %LDD% LEQ %Ctt% (echo %%i %%j %%k %%l %%m %%n %%o>> output.txt
) else (
echo No result
)
pause
please advise,