I have a file which has sections with different tables. I want to sum all the values contained within each column with the header N*dN
For example:
omega (dN/dS) = 999.00000
dN & dS for each branch
branch t N S dN/dS dN dS N*dN S*dS
11..6 0.000 532.0 266.0 999.0000 0.0000 0.0000 3.0 0.0
11..7 0.000 532.0 266.0 999.0000 0.0000 0.0000 4.0 0.0
11..12 0.000 532.0 266.0 999.0000 0.0000 0.0000 0.5 0.0
omega (dN/dS) = 1.00000
dN & dS for each branch
branch t N S dN/dS dN dS N*dN S*dS
11..6 0.000 532.0 266.0 999.0000 0.0000 0.0000 7.0 0.0
11..7 0.000 532.0 266.0 999.0000 0.0000 0.0000 2.0 0.0
11..12 0.000 532.0 266.0 999.0000 0.0000 0.0000 0.4 0.0
Desired output:
7.5
9.4
Maybe some modification of
awk '{s+=$8}END{print s}'
where I can specify the title of the column and make it print the separate results of each sum, not the sum of the sums...
awk
call, might be easier.