Skip to content

Instantly share code, notes, and snippets.

@criscokid
Forked from honorelsu/compare.rb
Last active August 29, 2015 14:12
Show Gist options
  • Save criscokid/2e142e52427219be9812 to your computer and use it in GitHub Desktop.
Save criscokid/2e142e52427219be9812 to your computer and use it in GitHub Desktop.
require 'CSV'
require 'easy_diff'
dcsexport = ARGV[0]
opsexport = ARGV[1]
def csv_to_hash(file_location)
result = {}
CSV.foreach(file_location) do |row|
results[row.values[0]] = row
end
results
end
dcs = csv_to_hash(dcsexport)
ops = csv_to_hash(opsexport)
puts "The exported file is of type #{dcs.class}"
puts "The exported file's first row is of type #{dcs.first.class}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment