I have a large data that have the following format
1 0.1 0.2 0.4
2 0.1 0.2 0.4
3 1.0 0.2 0.4
10 4.1 0.2 0.4
20 3.1 0.2 0.4
50 2.1 0.2 0.4
31 5.1 0.2 0.4
.
.
.
366 11.1 0.2 0.4
The first column is a day stamp and i have many columns as a field. The data is not spaced 1 to 366 evenly as you see.
My first objective is to generate a date column 1 to 366 with 1 day increment. Then I want to match and space my data according to this sequence leaving a an empty space when the sequence field is not present in my data.
My second objective is to average the corrected sequence of data every 10 colum elements and print the averaged result for the whole data.
I appreciate if anyone have a short awk routine in mind to do this job. I am new to awk
Thanks
1 0.1 0.2 0.4
2 0.1 0.2 0.4
3 1.0 0.2 0.4
10 4.1 0.2 0.4
20 3.1 0.2 0.4
50 2.1 0.2 0.4
31 5.1 0.2 0.4
.
.
.
366 11.1 0.2 0.4
The first column is a day stamp and i have many columns as a field. The data is not spaced 1 to 366 evenly as you see.
My first objective is to generate a date column 1 to 366 with 1 day increment. Then I want to match and space my data according to this sequence leaving a an empty space when the sequence field is not present in my data.
My second objective is to average the corrected sequence of data every 10 colum elements and print the averaged result for the whole data.
I appreciate if anyone have a short awk routine in mind to do this job. I am new to awk
Thanks