yuliji
1/6/2016 - 9:29 AM

ruby csv

ruby csv

require 'csv'

vcodes = Hash.new #vcode_id -> user_id
CSV.foreach('./vcode-user.csv') do |row|
    vcodes[row[0]] = row[1]
end

CSV.foreach('./vcode.csv') do |row|
    puts "#{row[0]},#{row[1]},#{vcodes[row[1]]}"
end