SUMMARY: counting common lines from file

2007-12-24 23:46:00

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.

Comments

Got something to say?

You must be logged in to post a comment.