From: Gregory Brown Date: 2005-11-21T14:48:24+09:00 Subject: Re: Parsing excel CVS data on a mac OSX to extract blocks of cells On 11/20/05, anne001 wrote: > What is the best way to get the excel CVS data into a Ruby 2D array for > further analysis? This might be overkill and more useful when it is more complete, but Ruby Reports has basic support for stuff like this, via DataSets. --- require "rubygems" require "ruportlib" my_data = Report::DataSet.load("foo.csv") --- this will create a DataSet filled with DataRows which can be indexed ordinally or by field name. (The first row of the CSV is used to define field names) example: --- my_data.each do |row| puts row["name"] end --- would print the value of the "name" column if it existed. both DataSet and DataRow are Enumerable, which might make finding your data easier. if you want to try this approach, sudo gem install ruport should get you the latest version The rather sparse documentation is housed at: http://ruport.rubyforge.org/docs/ You'd want to look at (and inspect the source on) Report::DataSet and Report::DataRow HTH, Greg