Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'csv'
- require 'pry'
- require_relative 'searchers'
- count = 0
- searcher = ColoradoSearcher.new
- source_file = File.join(__dir__, "csv/source.csv")
- target_file = File.join(__dir__, "csv/results.csv")
- # Match
- CSV.open(target_file, "w") do |csv|
- csv << ["id", "phone"]
- CSV.foreach(source_file, headers: true) do |row|
- license_number = row["PROVIDER ID"]
- phone = searcher.search_by_license(license_number)
- count += 1
- puts "##{count}: #{license_number} => #{phone}"
- csv << [license_number, phone]
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement