PDA

View Full Version : Count no of blank lines in qt



abhi8888
10th June 2015, 06:25
I need to know how to count no of blank lines in a file and also how to remove them.
ASAP

wysota
10th June 2015, 08:59
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.