in reply to Re: Reporting entries in a file (unix one-liner)
in thread Reporting entries in a file

If you are not in a *nix environment. This is a perl only oneliner.
perl -lane '$h{$_}++ for @F; END{print qq{$h{$_} $_\n} for sort keys % +h}' file
Switch to double quotes in Windows.

print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});