From: "Peña, Botp" Date: 2007-08-16T13:31:31+09:00 Subject: Re: grep a csv? From: Michael Linfield [mailto:globyy3000@hotmail.com] # inside ruby of course, no command line program > output.csv :) this is just a simple example, irb(main):018:0> puts File.readlines('filename.csv') this, is , a , test, foo this, is , a , test, bar this, is , a , test, Blah1 this, is , a , test, bar this, Blah, is , a , test this, is , a , Blah, test => nil irb(main):019:0> puts File.readlines('filename.csv').grep(/Blah/) this, is , a , test, Blah1 this, Blah, is , a , test this, is , a , Blah, test => nil irb(main):020:0> puts Ruport::Data::Table.new(:data => File.readlines('filename.csv').grep(/Blah/).map{|r| r.split(/,/)}) +---------------------------------------+ | this | is | a | test | Blah1 | | this | Blah | is | a | test | | this | is | a | Blah | test | +---------------------------------------+ => nil irb(main):021:0> kind regards -botp