I am new to shell script.I have records like below in 4 different files which have about 10000 records each, all records unique and sorted based on column 2.
1 2 3 4 5 6
---------------------------
SR|1010478|000044590|1|0|0|
SR|1014759|000105790|1|0|0|
SR|1016609|000108901|1|0|0|
SR|1017503|000111262|1|0|0|
I want to get column 2 of each file and sum up column 4 of each file and the whole process should not take more than 15-30 min. So my output should be a different file with records as below.
1 2 3 4 5 6
---------------------------
Total record count = 4
SR|1010478|000044590|4|0|0|
SR|1014759|000105790|4|0|0|
SR|1016609|000108901|3|0|0|
SR|1017503|000111262|2|0|0|
Can someone help me with this