Sum of the column of the CSV file
1
0
Entering edit mode
3.0 years ago
harry ▴ 40

I have a CSV file like below and I want to sum the columns 2 and column 3 and write the total at the end of the column as below:

Here is my file:

read,match,not_match
    human_file_0000003,5,2
    human_file_0000004,6,0
    human_file_0000005,6,9
    human_file_0000006,4,0
    human_file_0000007,2,0
    human_file_0000008,5,0
    human_file_0000009,3,0

And I want to output my file like below:

read,match,not_match
        human_file_0000003,5,2
        human_file_0000004,6,0
        human_file_0000005,6,9
        human_file_0000006,4,0
        human_file_0000007,2,0
        human_file_0000008,5,0
        human_file_0000009,3,0
                           31,11

In which you can see column 2 total is 31 and column 3 total is 11. Thanks in advance for your suggestion. I search for it but I can't find any solution for that.

CSV sum • 1.4k views
ADD COMMENT
0
0
Entering edit mode

In that, they add column 2 and column 3. Here I want to separate the sum of the total in column 2 and the separate sum of the total in column 3.

ADD REPLY
2
Entering edit mode
ADD COMMENT

Login before adding your answer.

Traffic: 2192 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6