Hi All,
I am opening a QTextStream to read one of a few sizeable text files (5MB - 80MB). The format of the file is about 30 lines of header info I can ignore, then many sets of 13 lines. I want to process all lines of the set of 13 together, then after a delay of about 100 mSec process the next group of 13, etc.
A few times, I have been able to do this successfully for the entire file. But most of the time, after processing some number of sets of 13, the reading of 13 gets out of synch and goes back to somewhere in the header portion of the file that I already read and ignored, and I'm reading something like 3 lines from one group, and 10 lines from the next group, then 6 lines from one group and 7 from another, etc.
I am using readLine() with an argument of zero, which means that any size line can be read. The lines vary from 84 bytes to 275 bytes. The first line of the set of 13 that are read are echoed to the console (printf), which is how I can see that things are getting out of synch. If I change my 100 mSec delay to 200 mSec, the same problem occurs. If I change the delay to 333 mSec, the problem appears to be minimized.
Having said all of that, I'm wondering if: (a) the printfs that I am using are taking up too much time; (b) readLine() itself is slow, and trying to do 13 of them in 100 mSec is not reasonable; or (c) any ideas other than the two just mentioned?
Any thoughts or suggestions? THANKS!
bjh
Bookmarks