![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum 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 |
| delete traling blank lines only | visu | UNIX for Dummies Questions & Answers | 1 | 03-05-2008 06:09 PM |
| delete blank lines from a file | sachin.gangadha | UNIX for Dummies Questions & Answers | 2 | 12-04-2007 04:13 PM |
| Delete blank lines at the end of file | TL56 | Shell Programming and Scripting | 3 | 10-25-2007 12:44 PM |
| regex to delete multiple blank lines in a file? | fedora | Shell Programming and Scripting | 6 | 10-11-2007 01:36 PM |
| delete blank lines or lines with spaces only | vascobrito | UNIX for Dummies Questions & Answers | 3 | 01-13-2004 04:36 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
delete blank lines with sed
I have a text file with blank lines fullfilled with spaces and others only containing the "Enter" caracter, the \012.
I would like to eliminate all them with the sed command. Is it possible? making: sed '/^$/d' <file should delete the blank lines but doesn't work for the lines that only have \012. Thanks in advance. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Try this:
sed '/^ *$/d' |
|
#3
|
||||
|
||||
|
This thread is ancient, but I wanted to say thanks to Perderabo. Your solution helped me out big time.
|
||||
| Google The UNIX and Linux Forums |