Created
January 10, 2013 23:41
-
-
Save theIV/4506757 to your computer and use it in GitHub Desktop.
dat data
This file contains hidden or 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
zip state long lat | |
00001 AK 123 456 | |
00002 AK 234 678 |
This file contains hidden or 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 'csv' | |
CSV.open('data.txt', { headers: true, col_sep: ' '}).each do |row| | |
puts row.inspect | |
puts row['zip'] | |
puts row['state'] | |
puts row['long'] | |
puts row['lat'] | |
#Location.create(zip: row['zip'], ) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment