Hi all

I am new to ruby and need a little help for a project.

My code so far is...

require 'csv'
CSV.foreach("c:\plantproducts.csv") do |row|
puts row.join(",")
end

puts "enter Product ID Number"
product_id = gets.chomp
CSV.foreach("c:\plantproducts.csv") do |row|
product_id == row[0]
end


*In my csv file the columns go as follows Product id, name, price, type

my question is when the program is running and when you enter in your
product id number as it matches in the csv file (such as 1001 and the
price is 8.00) how do I get the other data from the csv file such as
price so I can later use it and show to the program user)

Thanks

-- 
Posted via http://www.ruby-forum.com/.