PDA

View Full Version : Read the last three lines from a file



sangee
10th August 2012, 07:15
How to read the only last three lines from a file in qt?

BalaQT
10th August 2012, 08:03
use readLine function in QFile

hope it helps
Bala

sonulohani
10th August 2012, 08:20
Check this:-

8119

yeye_olive
10th August 2012, 10:46
Read the file backwards by chunks and stop when you have found the beginning of the third-from-the-end line or the beginning of the file. Of course reading a text file backwards only works for self-synchronizing encodings (well, the only thing you need is the ability to synchronize on line ending sequences).