I’m comparing each properties.log file in root dir: c:\executionsdktest_10.2.2 with a reference file. Time of execution in xx:xx:xx format is printed in the first 8 chars of the 28 lines of ref and properties.log file, since the time would be different and inconsequential I would like to skip over first 8 chars of any line containing a time. How can I accomplish this?
REM assume <refLog>.txt exists
<!logPath! (
For /F "tokens=*" %%R in (!refLogPath!) DO (
set logLine=
set /p logLine=
set refLogLine=%%R
REM Check line by line of log against refLog
REM if corresponding lines mismatch: skip xx:xx:xx
if NOT "!logLine!"=="!refLogLine!" (
Echo.
Echo line below is Incorrect:
set lnCorrect=false
REM output to command line: can be put into .log/.txt later
REM output ANY and ALL incorrect line in log file
ECHO !logLine!
)
)
)
You can take substrings of variables with
which would strip the first 8 characters from the line. Likewise for
refLogLine, of course.