I have a file that contains data like this:
column1 column2 column3
row1 a(1,1) a(1,2) a(1,3)
row2 a(2,1) a(2,2) a(2,3)
row3 a(3,1) a(3,2) a(3,3)
row4 a(4,1) a(4,2) a(4,3)
column4 column5 column6
row1 b(1,1) b(1,2) b(1,3)
row2 b(2,1) b(2,2) b(2,3)
row3 b(3,1) b(3,2) b(3,3)
row4 b(4,1) b(4,2) b(4,3)
I need to sum the elements of the array to show an output like this the output
column1 a(1,1)+a(2,1) a(3,1)+a(4,1)
column2 a(1,2)+a(2,2) a(3,2)+a(4,2)
column3 a(1,3)+a(2,3) a(3,3)+a(4,3)
column4 b(1,1)+b(2,1) b(3,1)+b(4,1)
column5 b(1,2)+b(2,2) b(3,2)+b(4,2)
column6 b(1,3)+b(2,3) b(3,3)+b(4,3)
I though that a way to do this is to specify the position of each number and them sum , but I have no idea how to do that.