Friday, 6 September 2013

AWK: to sum colums and insert output in new row of csv file

AWK: to sum colums and insert output in new row of csv file

Hi I have a csv file with below data in it.
8/22/2013 1,417,196,108
8/23/2013 1,370,586,883
8/24/2013 1,362,561,606
8/25/2013 1,177,575,904
8/26/2013 1,228,394,403
8/27/2013 1,276,168,499
8/28/2013 1,265,333,615
I want a script that can help me to sum 2nd column and insert result in
next row, so the output should look like:
8/22/2013 1,417,196,108
8/23/2013 1,370,586,883
8/24/2013 1,362,561,606
8/25/2013 1,177,575,904
8/26/2013 1,228,394,403
8/27/2013 1,276,168,499
8/28/2013 1,265,333,615
Total 9,097,817,018

No comments:

Post a Comment