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