I need to do multiple sums; my input file is:DATE|NATION|CITY|FILES|REVENUE|FREQUENCY|INVESTMENT20170807|USA|VIRGINIA|TIMES|1919150|1779|28207520170807|USA|NYC|ROADS|92877|41|159920170808|USA|PENS|ROADS|133001|7|120170808|USA|NYC|TIMES|361625|1592|0Sum $5 in every uniq of $1 (date)sum $5 in every uniq where $4==TIMES sum $5 in every uniq where $4==ROADSsum $5 in every uniq where $4==ROADS and $3==NYCarrange based on column $1my expected outputDATE|REV|TIMES|ROADS|ROADS&NYC20170807|2012027|1919150|92877|9287720170808|494626|361625|133001|0I only know how to sum based on 1 column awk -F| '{FS=OFS=|}{col[$1]+=$5} END {for (i in col) print i, col[i]}'
Sum multiple columns
awk