Created
June 29, 2011 20:05
-
-
Save ebot/1054804 to your computer and use it in GitHub Desktop.
kickstart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Initialize the var | |
| dupe_docs = {} | |
| # In your loop/routine | |
| dupe_docs[doc_id] = [] if dupe_docs[doc_id].nil? | |
| dupe_docs[doc_id] << encounter_number | |
| # At the bottom, output the totals | |
| puts "There were #{dupe_docs.count} duplicate documents:" | |
| dupe_docs.each do |doc, encounters| | |
| puts "#{doc} - #{encounters.count} encounters" | |
| encounters.each { |encounter| puts " #{encounter}" } | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment