I have a errorlog like this:
Code: Select all
14-12-2016 12:15:23 ABCABC WPU8D0006316 PROGRAM:ERROR MESSAGE
14-12-2016 13:35:23 DEFGHI WPU8D0006316 PROGRAM ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE
14-12-2016 14:25:23 ABCABC WPU8D0006316 PROGRAM ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE
14-12-2016 15:35:23 DEFGHI WPU8D0006316 PROGRAM ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE
14-12-16 16:35:23 DEFGHI WPU8D0006316 PROGRAM ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE
14-12-2016 17:45:23 ABCABC WPU8D0006316 PROGRAM ERROR MESSAGE
15-12-2016 12:15:23 ABCABC WPU8D0006316 PROGRAM ERROR MESSAGE
15-12-16 13:35:23 ABCABC WPU8D0006316 PROGRAM ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE
15-12-16 14:25:23 ABCABC WPU8D0006316 PROGRAM ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE
15-12-2016 15:35:23 ABCABC WPU8D0006316 PROGRAM ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE
15-12-2016 16:35:23 ABCABC WPU8D0006316 PROGRAM ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE ERROR MESSAGE
15-12-16 17:45:23 ABCABC WPU8D0006316 PROGRAM ERROR MESSAGE
This logfile is growing each day. I would like to have a batch script which create a new file with only the lines from a starting point till the end of the file. For example from '14-12-2016 17:45:23' till the end of file. So I can do some analyses on only the newest errors. The next time I will run this script it should create a new file from 15-12-2016 17:45:23 till the end of the new error file.
I found the tool Jrepl.bat which looks like it can do the job. But this tool has a lot of options i don't understand and i cant figure out what the regular expression need to be. Hopefully anyone else can? Thanks in advance.
Code: Select all
SET InFile=c:\logfile.txt
SET OutFile=c:\logfile_NEW.txt
SET ZoekText=14-12-2016 17:45:23 (i will put this in a external file)
call %SrcDIR%\jrepl "%ZoekText%" "$1" /f "%InFile%" /o "%OutFile%"