Help with parsing log file
Posted: 04 Dec 2009 20:33
Here is my current code with the help from avery_larry (thank you very much!!!).
What I'm doing is searching for a specific log file using a FOR loop because the directory name changes each day.
The temp2 directories are named in this manner:
temp2_11-30-09
temp2_12-01-09
temp2_12-02-09
temp2_12-03-09
temp2_12-04-09
What I need to do now is parse the log file that was found for this string "FINAL- Overall PASS"
The whole string from the log file looks something like this:
*****************************************************
****-FINAL- Overall PASS: Error1?:0 PASS | Failed:0 |
*****************************************************
Thanks for your help.
Code: Select all
@echo off
set serial=%1
IF EXIST i:\path.info (
goto SEARCHLOGS
) ELSE (
net use i: \\10.10.20.30\TestLogs
)
:SEARCHLOGS
cd /d i:\Current_Production\
for /d %%a in (temp2*) do (
if exist "%%a\results\%serial%_final_run.txt" echo "RUN LOG EXIST" && goto Rest of code
)
goto CHECKVENDOR
:CHECKVENDOR
for /d %%a in (temp2*) do (
if exist "%%a\VENDOR\results\%serial%_final_run.txt" echo "RUN LOG EXIST" && goto Rest of code
)
echo "RUN LOG DOES NOT EXIST" && goto Rest of code
What I'm doing is searching for a specific log file using a FOR loop because the directory name changes each day.
The temp2 directories are named in this manner:
temp2_11-30-09
temp2_12-01-09
temp2_12-02-09
temp2_12-03-09
temp2_12-04-09
What I need to do now is parse the log file that was found for this string "FINAL- Overall PASS"
The whole string from the log file looks something like this:
*****************************************************
****-FINAL- Overall PASS: Error1?:0 PASS | Failed:0 |
*****************************************************
Thanks for your help.