Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Parsing a text file
I have a program that I kick off out of Excel, which dumps results to a log
file. I'd like to parse the log file to see if everything worked OK. Of all the lines that get dumped, only the bottom is important... [lots of text] 03/30/2007 13:19:50 Loading is complete. Loading Status is as follows: Records Read: 1241 Loaded: 1241 Processed: 1099 Failed to Load: 0 Failed to Process: 142 03/30/2007 13:19:50 Import Finished [a little bit of text] What I'd like to do is find the last instance of these lines, specifically the Failed to Load and Failed to Process counts. That way after kicking off the program, I can tell the user what happened. So the first question is how to get the counts correctly. I can determine whether the line has "Failed to Load:" using InStr, but how do I say "parse out the number from the : to the end of the line"? This is something I'm not familiar with in VBA. The second question is whether or not I can loop backwards. Since this file can grow very large I think performance might be an issue. If I work from the bottom up, I can stop after processing something like a dozen lines. Any suggestions? Maury |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Parsing a Text file into worksheet with VBA | Excel Programming | |||
Parsing a Text File | Excel Programming | |||
Issue with parsing text file into worksheet | Excel Programming | |||
VBA Import of text file & Array parsing of that data | Excel Discussion (Misc queries) | |||
Parsing imported text file with macro... help! | Excel Programming |