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
get 550 5.7.1. Unable to relay for specific domains....
Exporting from SQL Server 2005 Table to Flat file with UTF-8 Problem.
Windows Server 2008 R2: missing start menu of installed applications
Exchange Server mail delay.
Erratic Cursor behavior on Word 2007
Communication between 2 remote Servers
SQL2005 View being forced to Encrypted
Using cfheader and cfcontent to obfuscate download path.
Excel addins
OWA failing externally