hi
i have file which hav following entries
1501,AAA,2.00
1525,AAA,2.00
1501,AAA,2.00
1525,AAA,2.00
1501,AAA,3.00
1525,AAA,3.00
1525,AAA,3.00
1501,AAA,3.00
1501,AAA,3.00
i want to have a o/p coloum wise
like
1501,AAA,13
1525,AAA,10
here 13 comes as a sum of last colum value corrosponds to 1501
similarly 10 comes as a sum of last colum value corrosponds to 1525
hi
can any one help me for little bit change in my first prob
i have file which hav following entries
1501,AAA,2.00
1525,AAA,2.00
1501,AAA,2.00
1525,AAA,2.00
1501,AAA,3.00
1525,AAA,3.00
1525,AAA,3.00
1501,AAA,3.00
1501,AAA,3.00
i want to have a o/p coloum wise
like
col1,col2,sum,count
1501,AAA,13 ,5
1525,AAA,10,4
here 13 comes as a sum of last colum value corrosponds to 1501
similarly 10 comes as a sum of last colum value corrosponds to 1525
as per sol given my era
awk -F "," '{ sum[$1 "," $2] += $3 } END { for (k in sum) print k "," sum[k] }' file
it is working fine but if i have to find count too then what need to change in this command