![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to delete empty lines | Aejaz | UNIX for Advanced & Expert Users | 5 | 04-30-2008 07:27 AM |
| display all lines | shary | Shell Programming and Scripting | 3 | 02-17-2007 12:09 PM |
| delete multiple empty lines | whatisthis | Shell Programming and Scripting | 3 | 11-09-2005 01:42 PM |
| How will you list only the empty lines in a file (using grep) | JosephGerard | UNIX for Dummies Questions & Answers | 1 | 07-21-2005 12:19 AM |
| cat and empty lines | Nicol | Shell Programming and Scripting | 4 | 11-13-2003 05:19 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
display no of empty lines
I want to display the number of empty lines in a file. I guess i should use 'grep'...but how..
10x for those who'll help. |
| Forum Sponsor | ||
|
|
|
|||
|
user egrep
1] you can use the egrep command like
egrep [a-z,a-Z,0-9] testfile.txt >> new.txt [ it will extract the all rows but except the blank rows] 2] then take the line count of the bth the files using wc -l testfile.txt -- [ say 15 with 5 blank lines] and wc -l new.txt [ it will give you only 10 lines] rm new.txt now substract the both values you will get the total blank values in your file Hope it will help you Regards, Swapneel |