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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -