How can I merge multiple files, of the same format, adding the values of specific columns while keeping others fixed?
If the columns of my files are of the format(where there are multiple rows):
File 1:
a1 b1 c1 d1 e1
File 2:
a2 b2 c2 d2 e2
File n:
an bn cn dn en
where a1=a2=an, b1=b2=bn
Output:
a b (c1+c2+...cn) (d1+d2+...dn) (e1+e2+...en)
For example,
File 1:
1 0 200 5 50
2 1 345 9 22
3 2 287 4 33
File 2:
1 0 355 4 12
2 1 366 5 7
3 2 202 7 16
I want the Output:
1 0 555 9 62
2 1 711 14 29
3 2 489 11 49
awkand friends come to mind ...