scripting in awk

Posted by benjamin button on Stack Overflow See other posts from Stack Overflow or by benjamin button
Published on 2010-04-20T12:48:07Z Indexed on 2010/04/20 12:53 UTC
Read the original article Hit count: 335

Filed under:
|
|

I have a text file with contents as below:

1,A,100
2,A,200
3,B,150
4,B,100
5,B,250

i need the output as :

A,300
B,500

the logic here is sum of all the 3rd fields whose 2nd field is A and in the same way for B

how could we do it using awk?

© Stack Overflow or respective owner

Related posts about awk

Related posts about unix