From: Chris Carter Date: 2007-08-16T12:40:03+09:00 Subject: Re: grep a csv? On 8/15/07, Michael Linfield wrote: > If i had a huge CSV file, and i wanted to pull out say all the lines > that contained the word "Blah1" and throw it in a temporary file what > would be the best approached. My thoughts were to use > > require 'rubygems' > require 'ruport' > require 'ruport/util' > > t=Ruport::Data:Table.load("filename.csv") > t.grep(/Blah1/) > > ### this sadly only returned an output of => [] > > any ideas? > > Thanks! > -- > Posted via http://www.ruby-forum.com/. > > File.readlines('filename.csv').grep(/Blah1/) -- Chris Carter concentrationstudios.com brynmawrcs.com