PDA

View Full Version : Qt 5 Read a Text File With Delimiters



te777
28th May 2013, 10:54
To find out how to read a text file with delimiters, go here:

http://tomtheprogrammer.wordpress.com/2013/05/27/qt-5-read-a-text-file-with-delimiters/

te777
9th November 2014, 07:05
A new updated link:

http://tomtheprogrammer.wordpress.com/2014/11/08/qt-5-read-a-text-file-with-delimiters/

anda_skoa
9th November 2014, 09:09
I this weren't such a good example on how not to do it, I would consider this SPAM.

Cheers,
_

te777
9th November 2014, 12:11
Can you give me some pointers on how to do it correctly? I would really appreciate it. I'm a functional programmer, a novice in may respects. Not experienced and polished. I would appreciate it if you could lead me to some better programming. I'll change the code accordingly. I was just trying to save someone some time searching the web for code solutions. Please help me make a better solution. I remember searching the web on how to read and disguard the delimiters to get to the text file data. My solution works, but if there is a better way, please show me. Thanks.

anda_skoa
9th November 2014, 14:25
I was just trying to save someone some time searching the web for code solutions.

You already did that by posting this on your blog. No need to spam the forum.
Especially no need to repeat the link again just to bump the thread.

The only "value" regarding the topic is the obvious suggestion to use

QFile for opening files (no, really?)
QTextStream for reading text files line by line
QString::split() for splitting a line at a delimiter

Hidden in tons of unrelated, applications specific code.

Cheers,
_