From: Robert Klemme Date: 2012-08-13T20:29:10+09:00 Subject: Re: Fastest way to get first line and ith line in a file? On Mon, Aug 13, 2012 at 11:49 AM, ajay paswan wrote: >> >> File.foreach('path/to/your/file').first >> > > What if I use: > > line = FasterCSV.foreach(filename).first > > giving the error: > Uncaught exception: no block given > :( This should work: line = FasterCSV.to_enum(:foreach, filename).first Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/