I am trying to take a csv file that looks like
customerID,firstname,lastname,charge5efc522,Romo,goodrick,37.894a7f057,jeny,vel,38.395efc522,Romo,goodrick,39.00
and make it into
firstname,lastname,chargetotal,customerIDROMO,goodrick,76.89,5efc522jeny,vel,38.39,4a7f057
so far I know that I can do
awk '{arr[$1]+=$4;}END{FOR (i in arr) {print i, arr[i];}'< file
any help would be appreciated