Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Which class is more efficient to read the data from text file ?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.4k Views 1 Watching
  • 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 Offline
    P Offline
    pratik041
    wrote on last edited by
    #1

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

    Pratik Agrawal

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fluca1978
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pratik041
        wrote on last edited by
        #3

        [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
        0
        • F Offline
          F Offline
          fluca1978
          wrote on last edited by
          #4

          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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved