Skip to content

Instantly share code, notes, and snippets.

@Panczo
Last active August 29, 2015 14:05
Show Gist options
  • Save Panczo/17e6b306d208a35bf2a1 to your computer and use it in GitHub Desktop.
Save Panczo/17e6b306d208a35bf2a1 to your computer and use it in GitHub Desktop.
Import from csv file
require 'csv'
CSV.foreach("test.csv") do |row|
username = row[0]
id = row[1]
roles = row[2..-1]
puts "User: #{username} id: #{id} has following role:"
roles.each do |r|
puts r
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment