I have a file with one column of data (i.e., one data value per line).
I interpret these data as multiple data sets;
the data sets are separated by one or more NA lines.
Note that the data sets are not the same length.
I want to convert this to a multi-column format
in which each data set is in a column
(in the same order as they appear in the input file).
For example, I have following file (in reality, the file contains much more data):
NA
4
3
5
7
8
3
NA
NA
NA
3
4
5
2
NA
2
7
4
6
9
NA
My expected output is the following:
4 3 2
3 4 7
5 5 4
7 2 6
8 . 9
3
The point between 8 and 9 is not really needed, but could also be replaced by a space.