From: George George Date: 2009-06-15T21:21:59+09:00 Subject: Re: formatting a listing Pascal J. Bourguignon wrote: > George George writes: > >> 3 >> any ideas? > It's hard to tell, since there seem to be random changes in the output > data vs. the input. Well, one random change. Or do you really mean > to subtract 1 from the first row, second column of the output? > What about the missing commas? Why the numbers are left-aligned? > thank you so much for the reply. The first column is a column of numbers separated by some white space. The idea is to capture the first block and create a column and the capture the next one and create another column adjacent to the previous one such that if 1 2 3 whitespace(one or more) 3 4 5 6 whitespace(one or more) 20 2 . . what i need is to transform that into (call it a matrix) such that every block of numbers separated by white space becomes a new row in the output e.g for he above case 1,3,20 2,4, 2 3,5, , 6, and so on. the comma separator is neccessary so that i can later parse it using any csv library or i can read it into a spreadsheet and Thank you -- Posted via http://www.ruby-forum.com/.