I am trying to aggregate a file containing the following data in UNIX.I need to add the amounts if the key is same.Key,amount,date,Timeabc-xyz-12234,45,15-08-91,23:00pqr-vgh-5241,15,15-08-91,21:00abc-xyz-12234,35,15-08-91,23:00pqr-vgh-5241,24,15-08-91,21:00abc-xyz-12234,655,15-08-91,23:00lkj-erf-8542,281,15-08-91,10:00pqr-vgh-5241,40,15-08-91,21:00Output should be as followingabc-xyz-12234,735,15-08-91,23:00pqr-vgh-5241,79,15-08-91,21:00lkj-erf-8542,281,15-08-91,10:00I tried by the following command ,but it just gives me uniqcat file | grep abc-xyz-12234 | uniqCan anyone please help me to get through this?
Addition of values in second columns if the first column entry is same in UNIX
csv