On Friday, January 17, 2003, 10:25:38 PM, Tom wrote: > Hit post by accident! The full final example: > header_row = "year,month,day,price\n" > index_of = header_row.chomp.split(',').to_h.invert # =>> {"month"=>1, "price"=>3, "day"=>2, "year"=>0} > data_row = "2002,1,17,1.5\n" > cells = data_row.chomp.split(',') > cells[index_of['year']] # =>> "2002" Isn't there a CSV processing library available? I imagine an API would provide hash-like access: data = CSV.new(filename) data.each do |record| # access record[:year], etc. end Your example is, well, clever, but a bit hard to follow. Gavin