I have a large series of text in 3 columns and its needs to be formatted to single row of every 12 rows of the columns; example data set.
1867 1 6.40
1867 2 5.90
1867 3 4.70
1867 4 3.70
1867 5 2.50
1867 6 2.20
1867 7 2.40
1867 8 3.20
1867 9 4.30
1867 10 5.20
1867 11 5.90
1867 12 6.90
1868 1 6.40
1868 2 5.90
1868 3 4.70
1868 4 3.70
1868 5 2.50
1868 6 2.20
1868 7 2.40
1868 8 3.20
1868 9 4.30
1868 10 5.20
1868 11 5.90
1868 12 2.50
The final format should look like this:
6.40 5.90 4.70 3.70 2.50 2.20 2.40 3.20 4.30 5.20 5.90 6.90 1867
6.40 5.90 4.70 3.70 2.50 2.20 2.40 3.20 4.30 5.20 5.90 2.50 1868
Thus, every 12 rows is selected and the data from the 3rd column is put into one row and the date from 1st column is put at the end of the rows. The second column is discarded. Can anyone provide a quick approach as how I can implement in awk95.
Appreciate a lot for the help. Definitely will provide stars.
Thanks.
1867 1 6.40
1867 2 5.90
1867 3 4.70
1867 4 3.70
1867 5 2.50
1867 6 2.20
1867 7 2.40
1867 8 3.20
1867 9 4.30
1867 10 5.20
1867 11 5.90
1867 12 6.90
1868 1 6.40
1868 2 5.90
1868 3 4.70
1868 4 3.70
1868 5 2.50
1868 6 2.20
1868 7 2.40
1868 8 3.20
1868 9 4.30
1868 10 5.20
1868 11 5.90
1868 12 2.50
The final format should look like this:
6.40 5.90 4.70 3.70 2.50 2.20 2.40 3.20 4.30 5.20 5.90 6.90 1867
6.40 5.90 4.70 3.70 2.50 2.20 2.40 3.20 4.30 5.20 5.90 2.50 1868
Thus, every 12 rows is selected and the data from the 3rd column is put into one row and the date from 1st column is put at the end of the rows. The second column is discarded. Can anyone provide a quick approach as how I can implement in awk95.
Appreciate a lot for the help. Definitely will provide stars.
Thanks.