From: Alexander Kellett Date: 2004-12-09T01:46:55+09:00 Subject: Re: count unique records me bored counts = array.inject(Hash.new { 0 }) { |counts, key| counts[key] += 1; counts } or something like that On Dec 8, 2004, at 5:37 PM, pustoi@spils.lv wrote: > Hello, > > Is there method in ruby like "uniq -c" command in Unix ? > uniq -c, --count prefix lines by the number of occurrences > > Thnx >