From: sto.mar@... Date: 2013-07-09T04:02:51+09:00 Subject: Re: Price lookup from sketchup to csv Am 08.07.2013 15:13, schrieb Nithi anand: > I need to perform a lookup on a CSV file. > The CSV file has 2 columns: Part No, Price > Given a specific Part No, I need to find the corresponding Price. > What would be the appropriate CSV method? $ cat csvtest.csv Part No,Price 11,1 13,2 17,3 19,4 $ irb 2.0.0p247 :001 > require 'csv' => true 2.0.0p247 :002 > csv = CSV.read('csvtest.csv', :headers => true) => # 2.0.0p247 :003 > part = csv.find {|row| row['Part No'] == '11' } => # 2.0.0p247 :004 > part['Price'] => "1" Regards, Marcus --