1. I have a folder containing text files of the config of each firewall.
2. I would like to search the folder with the list of IP address that I have. Filename is list.txt.
3. I know I could do this in findstr but I'm having problem on the output that I want, so far this is what I have:
Code: Select all
@Echo off
if exist results.txt del results.txt
findstr /m /g:list.txt *.* > results.txt
if %errorlevel%==0 (
echo Found! logged files into results.txt
) else (
echo No matches found
)
:: DONE
4. This only gives me the filename that contains the match (/m) so I don't know w/c IP matches w/c filename.
5. I want an output that will list each IP address first and below it the filenames that contains the IP.
Thanks for your help