From: Stephane Wirtel Date: 2008-01-23T17:20:09+09:00 Subject: Re: How to improve this code? You can try this code #!/usr/bin/env ruby require "csv" hash = Hash.new { |hash,key| hash[key] = [] } CSV.open( "file.csv", "r", "," ) do |row| hash[row[0]] << row[1] end Good luck Stephane