daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Oct 16th, 2018 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'csv'
  2. require 'pry'
  3. require_relative 'searchers'
  4.  
  5. count = 0
  6. searcher = ColoradoSearcher.new
  7. source_file = File.join(__dir__, "csv/source.csv")
  8. target_file = File.join(__dir__, "csv/results.csv")
  9.  
  10. # Match
  11. CSV.open(target_file, "w") do |csv|
  12.   csv << ["id", "phone"]
  13.   CSV.foreach(source_file, headers: true) do |row|
  14.     license_number = row["PROVIDER ID"]
  15.     phone = searcher.search_by_license(license_number)
  16.     count += 1
  17.     puts "##{count}: #{license_number} => #{phone}"
  18.     csv << [license_number, phone]
  19.   end
  20. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top