Results 1 to 3 of 3

Thread: Extracting strings in files

  1. #1
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Extracting strings in files

    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?
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 162 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Extracting strings in files

    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

  3. #3
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Extracting strings in files

    Quote Originally Posted by caduel View Post
    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
    Yeah thats what I was figuring but kinda hoped for a function like that already.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

Similar Threads

  1. visual studio project files - adding extra files
    By luf in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 21:05
  2. Replies: 5
    Last Post: 22nd September 2006, 08:04
  3. [Win32/VC++ 8.0] Strange problems with qrc_*.cpp files
    By mloskot in forum Installation and Deployment
    Replies: 6
    Last Post: 6th March 2006, 10:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.