Sample Header Ad - 728x90

Group by and sum in shell script without awk

0 votes
4 answers
8176 views
I have a file like: $ cat input.csv 201,100 201,300 300,100 300,500 100,400 I want to add the values in column 2 which has same value in column 1. Expected output is as follows: $ cat output.csv 201,400 300,600 100,400 I tried to do this by awk command but it is not working in Solaris. Please provide some alternative.
Asked by Sunny Monga (29 rep)
Nov 21, 2014, 11:02 AM
Last activity: Apr 23, 2025, 04:49 AM