SUMMARY: counting common lines from file

From: sun@bagdon.com
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";}}'
filename

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

Thanks!

Steve B.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:03 EDT