PDA

View Full Version : Count no of lines starting with # at beginning



abhi8888
10th June 2015, 11:08
i need to count no of lines with # at beginning in a file. kindly help me through

wysota
10th June 2015, 11:39
i need to count no of lines with # at beginning in a file. kindly help me through

Are you serious? What have you tried so far to solve your problem? How is the problem different from your previous one?

abhi8888
10th June 2015, 12:01
done..
thanks.. was striking it to me.

if i need to identify which line it is .. then is thr any method/ function for the same.

wysota
10th June 2015, 13:47
if i need to identify which line it is ..
Then count the lines.

ChrisW67
10th June 2015, 21:53
You can format a line number for output to a file using QString::number() or QTextStream amongst others.

This, and the other thread, sounds like a school assignment. You might get help here but you have to show that you have made an effort first.