Dear Gurus,
I have tab-delimited text files with matrix containing values. The first column is a identifier and other columns have the corresponding values. I would like to calculate the average value (total number/number of entries) for all entries from 2nd column to the last column in row wise.
For example,
file 1
Id per1 per2 per3
12 34.56 -0.54 12.5
13 0.15 -0.06 0.05
14 0.67 0.12 0.09
15 0.05 0.06 -0.07
Please note some values are negative numbers. I want to have a result file
ID avg
12 15.50
13 0.14
14 0.88
15 0.04
Can somebody suggest a script to deal with this? Thanks a lot indeed.