From: "Jesús Gabriel y Galán" Date: 2011-10-06T02:28:59+09:00 Subject: Re: Read thru Csv file and store it in variables On Wed, Oct 5, 2011 at 7:25 PM, ideal one wrote: > HI All, >        I need to read thru Excel file saved as CSV. Exclude the header > and store the data in variables. > Based on the number of records the script has to go thru that number of > iterations. > > I tried just s simple faster_csv code, which isnt working!! > > require 'rubygems' > require 'faster_csv' > > path = "C:/Users/test/Desktop/data.txt" > > FasterCSV.foreach(path) do |row| >    puts row > >  end > > > > C:/Program > Files/Ruby/lib/ruby/gems/1.9.1/gems/fastercsv-1.5.4/lib/faster_csv.rb:13:in > `const_missing': Please switch to Ruby 1.9's standard CSV library.  It's > FasterCSV plus support for Ruby 1.9's m17n encoding engine. > (NotImplementedError) > > > I am not aware of this error, Can any of you plz recommend better way to > achieve the result. In Ruby 1.9, fasterCSV has been made the implementation of the stdlib CSV, so you should be able to remove the rubygems (which btw, is also included by default in 1.9) and just make require 'csv' and CSV instead of FasterCSV. http://ruby-doc.org/stdlib/libdoc/csv/rdoc/index.html Jesus.