Skip to content

Instantly share code, notes, and snippets.

@twoism
Created May 7, 2009 18:34
Show Gist options
  • Save twoism/108266 to your computer and use it in GitHub Desktop.
Save twoism/108266 to your computer and use it in GitHub Desktop.
require 'csv'
file = "db/commission_junction/2087028_18584_20080827.csv"
cols, *rows = CSV::Reader.parse(File.open(file)).to_a
collection = rows.collect { |row| Hash[*cols.zip(row).flatten] }
puts collection.first.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment