experts i have a input file
> > >
0.000 5.064 1.0
0.100 9.064 5.0
0.200 5.064 6.3
0.300 9.064 4.2
0.400 5.064 2.3
> > >
0.000 4.977 1.2
0.100 6.977 1.8
0.200 4.977 1.2
0.300 6.977 1.8
0.400 4.977 9.6
I want to sum the third column values row wise and output should be
0.000 2.2
0.100 6.8
0.200 7.5
0.300 6.0
0.400 11.9
i tried
awk '{sum=0; for(i=1; i<=NF; i++) sum += $i; print sum}' input_file > out_file
But problem is that i cannot arrange file as i expect.I need some solution for the same.Thanks in advance.