VB Script to Scan A Log File For Certain Strings and Output them to a Text File
Posted on 2012-04-07
Loving the site its been a fantastic experience so far, need a bit of help with a script im trying to compile but getting nowhere with,
I have a log file which is generated by a Windows Server but is very clumsy to read, Every morning my team have to open this file and search for certain lines, this confirms whether or not a certain scheduled task has been successful or not, I want to make this much more streamlined, I would like a VB Script that can read the log file and scan it for certain sentences/messages and output that whole line into a seperate text file
I would like each occurance piped to a text file so that in essence its just a text file with the important bits I need
A vbs script to read Scheduledtasklog.txt and look for 4 strings
"task one was completed successfully"
"task two was completed successfully"
"task 3 was completed successfully"
"The Scheduled Task Fund Loader Was Successfull 948 Records were processed."
Each time it finds one export them to a seperate log file called clean.txt the lines may appear more than once and the last one will contain a different value every day
Only other thing worth noting is that each message has its own line in the big log file if that makes writing the script any easier?
Thanks guys, REALLY APPRECITATED