in reply to Dear Monks

Like this.
my %count; while(<DATA>) { chomp; tr/,/\t/; $count{$_}++; } foreach(sort keys %count) { print "$count{$_}\t$_\n"; } __DATA__ abcd,US abee,UK abcd,US adee,US
Replace <DATA> with "<>" to run it for real, and either pipe in the data file or pass the filename as an argument to the script.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.