The columns including two key features, one column to sum up, and some other (e.g,1) column that is not important.
key1, key 2, pr, trivial
abc, 43, 23, haha
abc, 43, 456, hok
bcd, 23, 89,kol
I want to add the sum column with the SAME key1 and key2, and output a csv file with 3 columns.
key1, key2, sumvalueofpr
in the above case, it is
key1, key2, sumvalueofpr
abc , 43, 479
bdc, 23, 89
(note: 479=23+456
)
To do with either Perl or Shell command is ok.
Is there only a particular value of key1/key2 pairs or do you want to check for any possible matches?
You could do a lower performance (but easy to code) method you could try a method like this: