PDA

View Full Version : Reading a text line per line



Momergil
19th July 2011, 15:46
Hello!

I'm creating a software that needs to read a text in a line per line mode, so between the lines other functions can be called and executed (for more about my software, [http://www.qtcentre.org/threads/43205-Reading-delimited-blocks-in-a-txt-file-and-puting-it-in-a-list-of-strings?p=197416#post197416]

The problem is that I can't use functions such as read() or readAll() (from QFile and related) because it reads all the text and just after that I can use the functions.

By the other hand, I couldn't figure out how to use functions such as readLine(), because all time that readLine() was called, it read allways the same first line of the text, it didn't move automatically to the second line and so forth, and I don't know how to do that manually ether.

Could somebody help me please? I wasn't capable of finding something about this in the help pages.


Thanks!

Added after 5 minutes:

Forget it; I solved the problem xD

Thanks anyway =]