Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Blank records from file. 2

Status
Not open for further replies.

mwesticle

Programmer
Nov 19, 2003
51
US
What's the easiest way to remove blank records from a file?
I've tried &quot;awk 'NF > 0' <filename>&quot;, but is there any other way?? Please help...
 
Try this:
Code:
sed -e '/^[  ]*$/d'
Inside the brackets are a Space and a Tab char.

Hope This Help
PH.
 
I would have used

awk '!/^[ ]*$/' filename

but your method (or PHV's) seem at least as good. (Space and tab in square brackets)

CaKiwi

&quot;I love mankind, it's people I can't stand&quot; - Linus Van Pelt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top