how can i get the sum and get average of records of files using awk programming
i have several output files like this
file 1
year col1 col2 col3 col4
1 0.4 0.1 0.3 0.8
1 0.3 0.2 0.9 2
2 0.1 0.3 0.8 0.7
2 0.2 0.4 0.9 0.7
3 0.4 0.3 0.8 0.3
3 0.2 0.4 0.4 0.2
4 0.8 0.4 0.8 0.3
4 0.5 0.4 0.5 0.5
file 2
year col1 col2 col3 col4;
1 0.4 0.1 0.3 0.8
1 0.3 0.2 0.9 2
2 0.1 0.3 0.8 0.7
2 0.2 0.4 0.9 0.7
3 0.4 0.3 0.8 0.3
3 0.2 0.4 0.4 0.2
4 0.8 0.4 0.8 0.3
4 0.5 0.4 0.5 0.5
file 3
year col1 col2 col3 col4
1 0.4 0.1 0.3 0.8
1 0.3 0.2 0.9 2
2 0.1 0.3 0.8 0.7
2 0.2 0.4 0.9 0.7
3 0.4 0.3 0.8 0.3
3 0.2 0.4 0.4 0.2
4 0.8 0.4 0.8 0.3
4 0.5 0.4 0.5 0.5
and i want the average out puts of all the records of a files to be summed and averaged in to one file and looks like this
year col1 col2 col3 col4
1
1
2
2
3
3
4
4
5
5