Monday, 29 December 2008

Remove blank lines in a file

Print every line that has at least one field:

This is an easy way to delete blank lines from a file (or rather, to create a new file similar to the old file but from which the blank lines have been removed).

awk 'NF > 0' data

No comments:

Post a Comment

Tweets by @sriramperumalla