Skip to content

Instantly share code, notes, and snippets.

@theIV
Created January 10, 2013 23:41
Show Gist options
  • Save theIV/4506757 to your computer and use it in GitHub Desktop.
Save theIV/4506757 to your computer and use it in GitHub Desktop.
dat data
zip state long lat
00001 AK 123 456
00002 AK 234 678
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