Delete lines containing empty fields

command linetext processing

I want to delete the lines containing empty fields in the last row $7

File:

1 1479870 5022248660 1 40001 189445122 740020
1 1911574 3015889020 1 33001 162049034 633004
1 1569783 5029193930 1 22001 133687297 522216
1 2069616 1025856960 2 25001 185608704 
1 1741598 5021128160 1 44001 164870942 644027
1 1052941 5020319300 1 10001 156161802 610007
1 1686734 5020347480 1 13001 131405824 513304
1 1872263 5029089700 1 23001 185092353 723017

Desired output :

1 1479870 5022248660 1 40001 189445122 740020
1 1911574 3015889020 1 33001 162049034 633004
1 1569783 5029193930 1 22001 133687297 522216
1 1741598 5021128160 1 44001 164870942 644027
1 1052941 5020319300 1 10001 156161802 610007
1 1686734 5020347480 1 13001 131405824 513304
1 1872263 5029089700 1 23001 185092353 723017

Best Answer

Try with this one :

awk  '$7!=""' file > final_output
Related Question