Hi
I have file containing 1 GB of data. But I have to read only the last 1000 data from the file.
How can I go for it? Reading the entire file takes more than 15 minutes.
Thanks for any help.
Hi
I have file containing 1 GB of data. But I have to read only the last 1000 data from the file.
How can I go for it? Reading the entire file takes more than 15 minutes.
Thanks for any help.
Read about QFile::seek and QFile::size
Lines? 1 GB TextFile??
Otherwise QFile::size is really all you need.
If by lines you mean records of a given size, you can seek to QFile::size() - recordsize*1000 ...
Johannes
If lines have non const length the problem is not trivial.
Only reading all file. I think that it is time to change a philosophy. 1 GB text file it is not good idea.
Bookmarks