From: Rob Biedenharn Date: 2007-11-15T05:31:03+09:00 Subject: Re: Transfer content of flat file to an array On Nov 14, 2007, at 3:15 PM, Surjit Nameirakpam wrote: > Scenario .. > > 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] > > How to do it ruby -e 'p File.readlines("/tmp/numbers.txt").map{|line| line.to_i}' Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com