From: Tommy Nordgren Date: 2009-09-17T22:00:58+09:00 Subject: Re: Itterate over an Array Extracting Data On 17 sep 2009, at 11.34, Daniel Russia wrote: > So I have the following array > > people = ["Employee 1", "Secretary", "Male", "54"] > ["Employee 2", "Manager", "Female", "44"] > ["Employee 3", "Chef", "Female", "22"] > Here you have THREE arrays, of which to are not assigned ANYWHERE. You forgot the outer brackets and the commans between elements of the outer array. > I would like to iterate over this array pulling out just the ages. How > can I do this? > > I tried the following: > > x = 0 > while x < people.length > puts people[x][3] > x += 1 > end > > How could I put the results into an array? IRB doesn't like my code. > -- > Posted via http://www.ruby-forum.com/. > ---------------------------------- The three things an undertaker should never say to a client: -Nice doing business with you. -Welcome back. -Have a nice day. (The King of ID) ---------------------------------- Tommy Nordgren tommy.nordgren@comhem.se