CSV::ROW
The various ways to refer to data
require "csv" # using Ruby 1.9
!
data = <Console,Units Sold 2007,Percent,Units Sold 2008,Percent
Wii,"719,141",49.4%,"1,184,651",49.6%
XBox 360,"333,084",22.9%,"743,976",31.1%
PlayStation 3,"404,900",27.8%,"459,777",19.3%
END_DATA
ps3 = CSV.parse(data, :headers => true, :header_converters => :symbol)[-1]
!
ps3[0] # => "PlayStation 3"
ps3[:percent] # => "27.8%"
ps3[:percent, 3] # => "19.3%"
ps3[:percent, ps3.index(:units_sold_2008)] # => "19.3%"