PDA

View Full Version : Extracting strings in files



ComaWhite
5th October 2008, 09:23
I have this model file that is plain text but very cryptic like. And I was wondering, I've googled but to no available. Or maybe I have been looking in the wrong places. Is there an equivelent of sscanf in Qt4?

caduel
5th October 2008, 09:53
you can

read a line and match it to a QRegExp
read your lines with a QTextStream and >>
read a line a parse its contents with a plain C sscanf


I suggest to try the QRegExp.

HTH

ComaWhite
7th October 2008, 00:01
you can

read a line and match it to a QRegExp (http://doc.trolltech.com/latest/qregexp.html)
read your lines with a QTextStream (http://doc.trolltech.com/latest/qtextstream.html) and >>
read a line a parse its contents with a plain C sscanf


I suggest to try the QRegExp.

HTH

Yeah thats what I was figuring but kinda hoped for a function like that already.:(