Results 1 to 2 of 2

Thread: Count no of blank lines in qt

  1. #1
    Join Date
    Jun 2015
    Posts
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Count no of blank lines in qt

    I need to know how to count no of blank lines in a file and also how to remove them.
    ASAP

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Count no of blank lines in qt

    Read the file line by line. If the text of the line is empty then the line is blank and you can skip that line. Otherwise write the line to another file. When you're done, rename the new file to the old name.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 5
    Last Post: 26th March 2013, 13:52
  2. How can I add blank space to a QTableView?
    By Paladin12 in forum Qt Programming
    Replies: 0
    Last Post: 15th August 2011, 11:39
  3. How to add blank space to a QTableView?
    By Paladin12 in forum Qt Programming
    Replies: 0
    Last Post: 3rd August 2011, 09:54
  4. QDialog is blank
    By daviddoria in forum Qt Programming
    Replies: 3
    Last Post: 7th June 2011, 04:10
  5. issue about blank area appear
    By cherrydou in forum Qt Programming
    Replies: 5
    Last Post: 23rd May 2008, 07:34

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
  •  
Qt is a trademark of The Qt Company.