S
Steve Farrar
I have a macro that processes a text file, reading data one line at a time.
Originally I did 2 "passes" on the file, the first step merely established
the number of lines in the file so that I could use a progress indicator on
the next pass through the file where I did my actual processing.
Then I got the bright idea that instead of opening and closing the file
twice I only needed to do it once and could save considerable processing
time. I would open the file, and pass each line to an arrayed variable.
After establishing the mumber of lines I would then access the array data
instead of opening the file again.
To my surprise this ended up saving virtually no time at all. Can anyone
explain this ?
Originally I did 2 "passes" on the file, the first step merely established
the number of lines in the file so that I could use a progress indicator on
the next pass through the file where I did my actual processing.
Then I got the bright idea that instead of opening and closing the file
twice I only needed to do it once and could save considerable processing
time. I would open the file, and pass each line to an arrayed variable.
After establishing the mumber of lines I would then access the array data
instead of opening the file again.
To my surprise this ended up saving virtually no time at all. Can anyone
explain this ?