From: Randy Kramer Date: 2007-11-02T23:31:52+09:00 Subject: Re: CSV with Ruby Newbie On Friday 02 November 2007 10:06 am, Zoltar Speaks wrote: > undefined method `process' for main:Object (NoMethodError) > from /usr/local/lib/ruby/1.8/csv.rb:560:in `each' > from solution.rb:4 Have you written/defined a method named "process"--it looks to me like they (in the book) have used "process" as sort of a generic method--something that doesn't exist (and isn't defined on that page) that you will have to write for yourself. Randy Kramer > require 'csv' > reader = CSV.open("csvfile", "r") > header = reader.shift > reader.each{|row| process(header, row)} > CSV.open("csvfile", "r") do |row| > qty = row[0].to_i > price = row[2].to_f > printf "%20s: $%5.2f %s\n", row[1], qty*price, row[3] || " ---" > end