jrobbins Posted April 14, 2007 Report Share Posted April 14, 2007 I have written macro that will parse out bits and pieces of a log file that is constantly written to by an application. The macro is using text file begin process to step through the file and pull out the new information. The macro works great, but as the time goes on it gets slower and slower because the log file gets bigger and bigger. Is there any way to just check lines of the log file that haven't already been checked and ignore the others? Thanks in advance, Jimmy Quote Link to comment Share on other sites More sharing options...
Cory Posted April 16, 2007 Report Share Posted April 16, 2007 Sure, keep track of the number of lines. On first run I would count the total number of lines and record that in the registry using Write Registry Integer. But start at 1 instead of zero. Then each time the macro runs do a Read Registry Integer, increment and start at that point. Then each subsequent time it runs increment that counter and write it back to the registry. You might also consider adding a file size and/or creation date check to ensure a new log file hasn’t been created. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.