Skip to content

Instantly share code, notes, and snippets.

@cp
Created November 19, 2013 04:45
Show Gist options
  • Save cp/7540466 to your computer and use it in GitHub Desktop.
Save cp/7540466 to your computer and use it in GitHub Desktop.
Simple script for taking a CSV of emails and converting it to something Mail.app likes.
require 'csv'
emails = Array.new
text = File.read('emails.csv').gsub(/\\"/,'""')
CSV.parse(text, headers: true, header_converters: :symbol) do |row|
emails << row[:email]
end
puts emails.join(',')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment