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. Count Row
Qt 6.11 is out! See what's new in the release blog

Count Row

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 331 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.
  • eefesafakE Offline
    eefesafakE Offline
    eefesafak
    wrote on last edited by eefesafak
    #1

    I want to count number of rows in a selected file. I also need to do it with QFile and QDir.
    Thanks for your help.

    JonBJ 1 Reply Last reply
    0
    • eefesafakE eefesafak

      I want to count number of rows in a selected file. I also need to do it with QFile and QDir.
      Thanks for your help.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @eefesafak
      Assuming by "rows" you mean "lines". Open the file for text read, use QFile::readline() to read lines, count as you go?

      1 Reply Last reply
      2
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by
        #3

        why do something programatically that already exists in command line utils?

        wc -l file

        but I digres since these kind of questions often indicate a sub-optimal file IO paradigm like line based file records. Bleck!

        The dystopian literature that served as a warning in my youth has become an instruction manual in my elder years.

        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