require 'csv' csv_data = CSV.read 'data.csv' headers = csv_data.shift.map {|i| i.to_s } string_data = csv_data.map {|row| row.map {|cell| cell.to_s } } array_of_hashes = string_data.map {|row| Hash[*headers.zip(row).flatten] }
csv_data = CSV.open('data.tab', 'r', ?\t)
You need to create an account or log in to post comments to this site.