Hi All,
I am trying to create a text file that contains a listing of all log files that contain a certain string in the first line. More specifically, SAS log files.
Currently I have a simple script that will search the entire system for "*.log" files and output the entire list to a text file.
Is there a way to only output the log files that contain a certain string?
Here is the current command:
dir /b /s /-p *.sas /o:n | findstr /E .sas >"%CD%"\win_file_list.txt
Every SAS log file contains the same string on the very first line. This string is:
1 The SAS System
So basically I want to search a file system for log files containing the string above, and output those file names to a text file.
Thanks in advance, Jason