User Tools

Site Tools


awk:delete_all_blank_lines_from_a_file

AWK - Delete all blank lines from a file

awk NF file.txt

awk '/./' file.txt

Example

Assuming a file, file.txt, exists with the following contents:

file.txt
aaaaa
bbbbb
 
ccccc
 
 
 
ddddd
 
eeeee

returns:

aaaaa
bbbbb
ccccc
ddddd
eeeee
awk/delete_all_blank_lines_from_a_file.txt · Last modified: 2021/01/06 16:15 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki