I have two columns of data in csv format as shown below from a prediction server.The first column is an index position for each variable for each prediction. Therefore new data starts at index 1.
1,2.0
2,1.5
3,1.4
1,1.1
2,2.0
3,1.5
4,2.0
5,1.6
1,2.0
2,4.0
.
.
.
I would like to have the data in this format instead,
2.0,1.1,2.0
1.5,2.0,4.0
1.4,1.5
2.0
1.6
For ease of work, The empty 'cells' can be filled with zeros or # e.g
2.0,1.1,2.0
1.5,2.0,4.0
1.4,1.5,0
0, 2.0,0
0, 1.6,0
Someone with an elegant way to do this in Ruby?