Skip to content

Instantly share code, notes, and snippets.

@tlehman
Created August 2, 2012 23:37
Show Gist options
  • Select an option

  • Save tlehman/3242056 to your computer and use it in GitHub Desktop.

Select an option

Save tlehman/3242056 to your computer and use it in GitHub Desktop.
Upload subscribers
require 'csv'
require 'sequel'
def get_subscribers(filename)
subscribers = []
CSV.foreach(File.expand_path(filename)) do |row|
subscriber = {}
subscriber[:name] = "#{row[0]} #{row[1]}"
subscriber[:company] = row[2]
subscriber[:email] = row[3]
subscribers << subscriber
end
subscribers
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment