Quantcast
Channel: Linux and Mac Hacks
Viewing all articles
Browse latest Browse all 39

Linux & Mac OSX: Remove blank lines from a file with awk

$
0
0
Here is nice awk one liner to remove blank lines from a file, just replace FILENAME with the file you want the blank lines removed from:

awk '/./' FILENAME

Here is a sed one liner to remove blank lines from a file, just replace FILENAME with the file you want the blank lines removed from:

sed -i -e 's/^$/g' FILENAME


Viewing all articles
Browse latest Browse all 39

Latest Images

Trending Articles



Latest Images