Write output adding lines

Microsoft Windows xp professional editio...
October 17, 2009 at 09:08:00
Specs: Windows XP
I have writen this batch file (I learned this through your previous posts :-) ):

For /f "tokens=* delims=" %%a in (search_list.txt) Do ( findstr /c:%%a data.txt > result.txt )

You can see that I am trying to find all the lines in "data.txt" containing strings from "search_lis.txt" and write results to "resuts.txt". The issue is that I have only the search for last string is writen to "result.txt". I guess that the last result overwrites previous. Can you help me prevent this and have all the results contained in "result.txt".

Thank you for your expertise!

See More: Write output adding lines

Report •

October 17, 2009 at 11:38:10
more simply:

for /f "tokens=* delims= " %%a in (search_list.txt) do (
find "%%a" < data.txt >> result.txt

Helping others achieve escape felicity


Report •

October 18, 2009 at 05:18:53
That is what I needed!

Many thanks.

Report •

Related Solutions

Ask Question