Skip to content

Instantly share code, notes, and snippets.

View jaake's full-sized avatar

Jacob Margason jaake

View GitHub Profile
@etagwerker
etagwerker / ruby_count_indexer.rb
Created December 3, 2010 13:58
Ruby script to count words in a file and order them by occurrences
# Script to index words inside a text file.
# Words separated by spaces.
# Usage: ruby indexer.rb /path/to/file.txt
file_path = ARGV[0] || "votacion.txt"
WORDS_COUNT = {}
file = File.open(file_path, "r")
puts "Indexing #{file_path}"