How to display columns that start with 0 and sum values in output string? AWK -


there file 3 columns. display sum of second , third number each string if first number of columns 0.

1,2,3 3,4,5 0,1,2 0,0,7 

result:

3 7 

i trying reason receive 2 0 result:

awk '$1 ~ /^0/ {print $2 + $3}' zadanie.csv 

as file comma separated need provide awk value of input field separator comma in case.

awk -f, '$1 ~/^0/ {print $2+$3}' foo 3 7 

Comments