Off topic:awk help to print lines when the columns are non zeros
0
0
Entering edit mode
6.6 years ago
geneart$$ ▴ 50

Hi I have a file with the following format:

filename is foo.txt

abcd 1 0 0 2
abef 2 0 0 0
able 2 1 2 0
able 1 0 0 0
efgh 0 0 0 0

I wrote an awk script to delete the row with all columns with 0. But I am getting syntax error. SO I am sure this is very simple.

Please can anytime help me fix this?

awk 'BEGIN{i=1; While($2==0)($3==0)($4==0) {print $0} }' foo.txt
next-gen • 1.4k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2130 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6