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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove lines that are all spaces, tabs or empty

Status
Not open for further replies.

adsorrell

Programmer
Apr 16, 2010
2
US
I have a file in which I need to remove all lines that are:
1) empty
2) contain nothing but tabs, spaces or combination thereof.

I've tried awk '/[:space:]/{print}'

which did remove lines with all tabs and spaces, but also removed a line with a data value embedded in tabs.

I'm open to any solution - awk / sed, you name it.

Thanks!
 
awk '!/^[:space:]*$/'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top