Skip to content

Instantly share code, notes, and snippets.

@mattfitzgerald
Created February 24, 2012 04:27
Show Gist options
  • Save mattfitzgerald/1897635 to your computer and use it in GitHub Desktop.
Save mattfitzgerald/1897635 to your computer and use it in GitHub Desktop.
file = File.new("message_process.txt", "r")
id_counts = {}
while (line = file.gets)
id = line.split[-2].split(":")[1].chop
if id_counts.has_key? id
id_counts[id] += 1
else
id_counts[id] = 1
end
end
id_counts.reject!{|k,v| v == 1 }
puts id_counts.keys.map(&:to_i).inspect
# [644, 364604, 387056, 364661, 387046, 364794, 702, 166535, 364675, 364609, 364621, 639, 364666, 915, 652, 389902, 438336, 364670, 654]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment