I want to create a batch file that executes a command, but before the command is executed, it must look up a log to see if it contains the following line:
DOFWADX 2013/07/24 15:42:33 -I- DATABASE IS OK.
I am looking for the specific text - "DATABASE IS OK". The problem is that there will be multiple entries of this line in the log, with the latest ones being appended to the file.
My Question: How do I look for the latest/last entry in the log file containing "DATABASE IS OK". Also, is there a way we can get the time the log file was changed/last updated and filter the "DATABASE IS OK" line by that date and time entry, if it exists in the log file.
DOFWADX [date and time log file was changed/updated] -I- [look for this line >>]DATABASE IS OK.
Once this line with the latest datestamp is found, I want to execute a command, doesn't matter what it is now.