William James wrote:
> William James wrote:
>> >
>> > > 166.00        2.5714E-03        1.7597E-03
>> p IO.readlines( 'input.dat').grep( /^\d/ ).
>>   map{|s| s.strip.split.map{|x| x.to_f}}.select{|a|
>>     a.first.between?(158,165) }
> 
> Please pardon my perverse prolixity.  I threw in a "strip" even though
> my subconscious told me it was superfluous.
> 
> p IO.readlines( 'input.dat').grep( /^\d/ ).
>   map{|s| s.split.map{|x| x.to_f}}.select{|a|
>     a.first.between?(158,165) }

I took out your superfluous grep() too, but it doesn't help your cause 
enough.

Peña, Botp wrote:
> 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


A winner by a nose.  :)
-- 
Posted via http://www.ruby-forum.com/.