Quote:
Originally posted by aigles
Code:
awk 'NF>0 {count++} END { print count}' input_line
|
The above would count the number of non-blank lines. To count the number of blank lines, subtract from the record count.
Code:
awk 'NF>0 {count++} END { print NR-count}' yourFile
Another way would be to use grep -c.
Code:
grep -c "^[ \t]*$" yourFile
Damian