Created
August 21, 2012 21:13
-
-
Save bil-bas/3419440 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
require 'fastercsv' # Gem I'm assuming is beign used, but there are others. | |
hash = {} # So apeiros_ doesn't murder me | |
FasterCSV.foreach("path/to/file.csv") do |line| | |
hash[line[0].to_sym] = { :location => line[1], :device_type => line[3] } | |
end | |
# then you can reference with | |
hash[:frog][:location] | |
# and | |
hash[:frog][:device_type] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment