From: Phrogz Date: 2007-11-15T05:30:02+09:00 Subject: Re: Transfer content of flat file to an array On Nov 14, 1:15 pm, Surjit Nameirakpam wrote: > I have a text file > > 23 > 24 > 56 > 78 > 90 > 89 > > I want to transfer this content into an array, > numArr=[23,24,56,78,90,89] IO.read( 'myfile.txt' ).scan( /\d+/ ).map{ |s| s.to_i } ...assuming you don't have any floating point numbers in there.