Last active
August 29, 2015 14:05
-
-
Save Panczo/17e6b306d208a35bf2a1 to your computer and use it in GitHub Desktop.
Import from csv file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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