more useful options | |
PerlMonks |
Re: Comparing each line of a file to itselfby hippo (Bishop) |
on Jan 13, 2019 at 13:02 UTC ( [id://1228465]=note: print w/replies, xml ) | Need Help?? |
Hello, Manju Moorthy, and welcome to the Monastery. You could do this in Perl but is there any need when $ sort file | uniq -cwould seem to be all you require? Just for fun here's a Perl equivalent $ perl -ne '$x{$_}++;END {printf ("%5i %s", $x{$_}, $_) for keys %x};' file
In Section
Seekers of Perl Wisdom
|
|