I have a batch script which will print the entire line of search string into a text file.
for %%i in (log.txt) do ( FINDSTR /G:pattern.txt %%i >> outpu
This uses a helper batch file called findrepl.bat from - http://www.dostips.com/forum/viewtopic.php?f=3&t=4697
@echo off set "var=searchterm" type "file.txt"|findrepl "%var%" /o:-1:+1 |find /v "%var%"