Microsoft
Software
Hardware
Network
Question : Loop searching a text file for specific strings
I have a text file with 3,682 file names, one filename per line - call it "GUIDS.txt"
I have a log file called "combined_log.txt"
I want to search combined_log.txt to see if any of the 3,682 file names appear in this log text file
If any line item in GUIDS.txt is found in combined_log.txt, I want to output it to: "findings.txt"
I created a batch file called GUIDS.bat
ECHO OFF
REM GUIDs.bat
FOR /F %%i IN (c:\TEMP\GUISD.TXT) do FIND %%i C:\temp\combined_log.txt
I then ran the batch file as:
GUIDS.bat >> findings.txt
However, I get an error:
FIND: Parameter format incorrect.
I am working in Windows XP and this seems like a simple loop script.
Does anyone have a solution that works?? I don't want to do an individual "FIND" command for each of the 3,682 filenames!!!
Thanks!
Answer : Loop searching a text file for specific strings
put your find string in double quotation.
try this.
ECHO OFF
REM GUIDs.bat
FOR /F %%i IN (c:\TEMP\GUISD.TXT) do FIND "%%i" C:\temp\combined_log.txt
hope this will solve your problem.
Random Solutions
Cannot join domain due to dns issues
Sage CRM secure web link for external users
Apache2 name-based virtual host & SSL
logical restore?
Thunderbird inexplicably crashing....
DataBinding: 'System.Data.Common.DataRe
cordIntern
al' does not contain a property with the name 'IdKeuze'.
Disable Windows SBS CSE Policy
Small Business Server Crital alerts
fortigate 60b, add second subnet needs internet - easy
open Firmware