Dear Experts,
I would like to calculate average over few hundred thousands lines of data. I would like to use awk to that but I just could not figure out how the syntax to this. The sample data as below:
Code:
5 31.879999
5 27.227272
5 32.049999
5 33.000000
5 37.000000
5 35.500000
5 43.900002
5 39.285713
5 43.400002
5 21.000000
15 39.333332
15 33.818180
15 27.400000
15 28.125000
15 47.857143
15 41.333332
15 33.200001
15 34.666668
15 60.000000
15 10.000000
25 49.250000
25 15.000000
25 13.666667
25 31.000000
25 49.000000
25 55.000000
25 60.333332
25 31.000000
25 48.000000
35 29.166666
35 43.599998
35 32.200001
35 27.750000
35 40.666668
35 37.000000
35 39.000000
35 59.000000
35 61.000000
45 36.400002
45 27.500000
45 37.000000
45 29.666666
45 47.000000
45 25.000000
45 38.500000
45 40.000000
45 44.000000
55 56.500000
55 18.333334
55 10.666667
55 19.000000
55 70.500000
55 39.500000
I would like to calculate the average for numbers in second column corresponding to number 5 in first column. Then average for numbers in second column corresponding to number 15 in first column. And so on.
at the end I want final data to be
Code:
5 average
15 average
25 average
35 average
.
.
.
Appreciate any help in advance.
Thank you