Originally posted by zh159 at 2007-12-25 02:03 PM:
Put FINDSTR inside for
FOR /F "eol=; tokens=7 delims= " %%i in ('FINDSTR /i %1 log.txt') do Echo %%i
This will find all text lines in log.txt that contain %1. I only need the first line that contains %1. I looked for parameters in findstr and for but couldn't control finding only one line. So I used goto to jump out of the loop.
Now replace with this:
for /f "tokens=7 delims= " %%i in ('findstr /n %1 log.txt^|findstr /b "1:"') do echo %%i >> temp03.txt
[ Last edited by jinthree on 2007-12-25 at 03:14 PM ]
