I have a column of numbers in a csv file and I want to break the column at regular intervals and transpose them into multiple rows. For example:
Dummy input file:
10
25
09
04
14
100
01
10
100
04
04
01
04
Expected output (Breaking at regular intervals of 3):
10 25 09
04 14 100
01 10 100
04 04 01
04
I am trying to do this in R by using for
loop but haven't succeeded. I am not getting the desired output but also there are more than 10 million points like these in a single column. So I am not sure if using loop is an efficient way. I have googled and seen other such queries on stackexchange like split string at regular intervals and How to split a string into substrings of a given length?. But it hasn't solved my problem.
Nevertheless, any help with this is appreciated.