Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Which class is more efficient to read the data from text file ?

    General and Desktop
    2
    4
    2093
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pratik041 last edited by

      if i want to get sub string in each line when required.

      Pratik Agrawal

      1 Reply Last reply Reply Quote 0
      • F
        fluca1978 last edited by

        I would use qtextstream, I don't know which other alternatives could be more efficient...

        1 Reply Last reply Reply Quote 0
        • P
          pratik041 last edited by

          [quote author="fluca1978" date="1322737551"]I would use qtextstream, I don't know which other alternatives could be more efficient...[/quote]

          how can i can access each substring separated by space in each line in that?

          Pratik Agrawal

          1 Reply Last reply Reply Quote 0
          • F
            fluca1978 last edited by

            Please read the "documentation":http://doc.qt.nokia.com/4.7/qtextstream.html#details:

            bq. There are three general ways to use QTextStream when reading text files:
            Chunk by chunk, by calling readLine() or readAll().
            Word by word. QTextStream supports streaming into QStrings, QByteArrays and char* buffers. Words are delimited by space, and leading white space is automatically skipped.
            Character by character, by streaming into QChar or char types. This method is often used for convenient input handling when parsing files, independent of character encoding and end-of-line semantics. To skip white space, call skipWhiteSpace().

            1 Reply Last reply Reply Quote 0
            • First post
              Last post