LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing a Text file into worksheet with VBA [email protected] Excel Programming 3 October 25th 06 02:51 AM
Parsing a Text File [email protected] Excel Programming 8 January 30th 06 04:43 PM
Issue with parsing text file into worksheet primrose Excel Programming 1 May 25th 05 05:09 PM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM
Parsing imported text file with macro... help! scrupul0us[_2_] Excel Programming 0 September 7th 04 10:13 PM


All times are GMT +1. The time now is 12:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"