From: "Peña, Botp" Date: 2007-10-18T11:31:26+09:00 Subject: Re: extracting values from consecutive lines From: 7stud -- [mailto:bbxx789_05ss@yahoo.com] # William James wrote: # > p IO.readlines( 'input.dat').grep( /^\d/ ). # > map{|s| s.strip.split.map{|x| x.to_f}}.select{|a| # > a.first.between?(158,165) } # # Better. Still slower. how about this, a=[] ARGF.each do |line| if line =~ /158/ .. line =~ /165/ a << line.split.map{|x|x.to_f} end end 'just joining the fun in ruby :) kind regards -botp