Sum up the column values group by using some field

view story

http://www.unix.com – Code: 12-11-2012,PNL,158406 12-11-2012,RISK,4564 12-11-2012,VAR_1D,310101 12-11-2012,VAR_10D,310101 12-11-2012,CB,866 12-11-2012,STR_VAR_1D,298494 12-11-2012,STR_VAR_10D,309623 09-11-2012,PNL,1024106 09-11-2012,RISK,4565 09-11-2012,VAR_1D,317211 09-11-2012,VAR_10D,317211 09-11-2012,CB,985 09-11-2012,JOB,640 09-11-2012,STR_VAR_1D,305364 09-11-2012,STR_VAR_10D,317211 I have a flat file like above, So all I need to sum up column 3 values if column 2 matches word VAR for coulmn 1 date So foe 12 Nov I summed up VAR_1D, VAR_10D, STR_VAR_1D, STR_VAR_10D same goes for 09 Nov So my final file lo (HowTos)