in reply to sorting arrays
The obvious Perl solution is to use a hash an increment the key each time the item is found. If original order is important, in addition to the hash, push the value into an array unless the key already exists in the hash. You can use the array to get a hash slice in the original order.sort file | uniq -c
Cheers - L~R
|
|---|