From: Rob Biedenharn Date: 2009-04-01T00:56:06+09:00 Subject: Re: Array read to seperate items On Mar 31, 2009, at 11:27 AM, Stuart Clarke wrote: > Hi all, > > This might be a stupid question. > > I have an array which gets data added to in a loop like so: > > a b c d e f > a b c d e f > > I am aware calling join("\n")on this array will separate each line of > the array with a new line, but I want to separate the individual items > and load them into there own arrays for example > > array a = a, a > array b = b, b > > etc etc. > > In summary I want to output my data exactly how it is, but because I > want to load into structured columns on my GUI I want the data broken > down so it can be loaded to the relevant columns. > > Thanks in advance > -- > Posted via http://www.ruby-forum.com/. Array#transpose irb> [[1,2,3,4,5],%w[a b c d e]].transpose => [[1, "a"], [2, "b"], [3, "c"], [4, "d"], [5, "e"]] -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com