Created
January 22, 2009 19:10
-
-
Save dkubb/50671 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header = nil | |
FasterCSV.foreach(FILE) do |row| | |
row.map! { |v| v.strip!; v == 'NULL' || v.blank? ? nil : v } | |
unless header | |
header = row.freeze | |
next | |
end | |
# create a Hash where the key is the column name, and the value is the field value | |
data = header.zip(row).to_hash | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment