I've this kind of data in file :
2012-01-01 43.00 1 50.00 1 53.00 1 49.00 1 49.00 1 45.00 1 53.00 1 44.00 1 42.00 1 52.00 1 54.00 1 52.00 1 51.00 1 53.00 1 53.00 1 52.00 1 -999.00 0 38.00 1 21.00 1 19.00 1 31.00 1 37.00 1 36.00 1 32.00 1
2012-01-02 14.00 1 27.00 1 36.00 1 40.00 1 32.00 1 31.00 1 16.00 1 3.00 1 21.00 1 36.00 1 42.00 1 44.00 1 44.00 1 46.00 1 47.00 1 -999.00 0 36.00 1 24.00 1 28.00 1 33.00 1 36.00 1 40.00 1 47.00 1 48.00 1
2012-01-03 46.00 1 48.00 1 49.00 1 50.00 1 51.00 1 51.00 1 43.00 1 37.00 1 34.00 1 43.00 1 43.00 1 39.00 1 39.00 1 43.00 1 -999.00 0 32.00 1 34.00 1 19.00 1 18.00 1 21.00 1 22.00 1 40.00 1 46.00 1 46.00 1
Each line contain the date (YYYY-MM-DD) and one value by hour (seperate by " 1 "). But If the value equal '-999.00', the separator began " 0 ".
I'ld like to obtain a file like this with awk :
2012010100 43.00
2012010101 50.00
2012010102 53.00
...
2012010123 32.00
2012010200 14.00
...
2012010223 48.00
2012010300 46.00
...
2012010323 46.00
... (for 1 year)
So, each line contain the date (with a new format YYYYMMDDHH) and the value corresponding to the hour.
Someone have an idea ? thanks
2012010100come from? that is, what are the last two zeros? Also, please show what you tried so far, since an awk loop seems to be quite simple1and0in between numbers?