Skip to content

Instantly share code, notes, and snippets.

@vincentopensourcetaiwan
Created April 1, 2019 11:01
Show Gist options
  • Save vincentopensourcetaiwan/ae733eeab14b0db1417d27d8e603f012 to your computer and use it in GitHub Desktop.
Save vincentopensourcetaiwan/ae733eeab14b0db1417d27d8e603f012 to your computer and use it in GitHub Desktop.
require 'csv'
array_107 = []
array_108 = []
results = []
csv_text_107 = File.read("tmp/107.csv")
csv = CSV.parse(csv_text_107, headers: false)
csv.each do |row|
array_107 << row
end
csv_text_108 = File.read("tmp/108.csv")
csv = CSV.parse(csv_text_108, headers: false)
csv.each do |row|
array_108 << row
end
array_107.each do |school|
match = array_108.select { |s| s[1] == school[1] }
results << school if match.empty?
end
CSV.open("tmp/#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")}-results.csv", "wb") do |csv|
results.each do |result|
csv << result
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment