Skip to content

Instantly share code, notes, and snippets.

@etagwerker
Created May 28, 2013 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etagwerker/5661973 to your computer and use it in GitHub Desktop.
Save etagwerker/5661973 to your computer and use it in GitHub Desktop.
Simple script to turn a CSV into YAML
require 'csv'
require 'yaml'
array = []
i = 0
CSV.foreach 'mentions.csv' do |l|
hash = {}
hash['url'] = l[2]
hash['date'] = l[1]
hash["mention_#{i}"] = ''
i += 1
array << hash
end
puts array.to_yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment