From: Chris Kottom Date: 2011-02-16T16:43:47+09:00 Subject: Re: How to read CSV in Ruby 1.9.2 --00235440bead63d590049c617097 Content-Type: text/plain; charset=UTF-8 Simple example... require "csv" # require the CSV library CSV.foreach("path/to/file.csv") do |row| # open your file and loop through the rows p row # print each row's contents p row.count # count the number of values in each row (CSV::Row is Enumerable) ... end On Wed, Feb 16, 2011 at 6:55 AM, Tom Llobrera wrote: > I am totally new to rails. I have a school project that requires me to > import data from a CSV file to mysql database. I read the documentation > regarding CSV in ruby 1.9 but I don't understand since I am very new to > to this. Can someone show me a very simple example how to read data from > CSV file using the ruby 1.9 CSV. I know this might be too much to ask > but I really need help. Pls be patient with me... Pls.. > > > Tom > > -- > Posted via http://www.ruby-forum.com/. > > --00235440bead63d590049c617097--