SUMMARY: counting common lines from file

From: <>
Date: Fri Oct 04 2002 - 20:11:40 EDT
Per our request to identify total count of a common line in a file. Got
lots of answer, too many to list (sorry...). But I did keep the notes on
each first successful answer:

Fabrice Guerini
$sort {file} | unix -c

Darren Dunham
$perl -lne '$l{$_}++; END{while(($l,$n)=each(%l)){print "$n\t$l";}}'

Thanks to everyone, not just the answer, but all the insights.


Steve B.
sunmanagers mailing list
Received on Fri Oct 4 21:24:45 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:55 EST