Hello all,
I have a large number of dat files in which multiple variables are arranged in a single column one after the other. Each variable is separated by several -9.
Like so: 1 2 3 4 -9 -9 -9 -9 5 6 7 8 -9 -9 -9 -9 9 10 11 12 13 …
Now, I want to reshape them so I have one variable per column and get rid of the -9. Like so:
A B C
1 5 9
2 6 10
3 7 11
4 8 12
Please note that the number of variables, their length and the number of -9 between them may change.
Any ideas ?
Best Answer