Re: [Perl-unix-users] Counting words

2006-04-26 Thread listmail
If it doesn't have to be perl: cat t.txt | awk '{ print $1 }' | sort | uniq -c Sharp, Craig wrote: I have a file that contains many li˜es. Here is an example: evaluate eaprod 7844 2 15688 0 2 evaluate agncyis 7347 2 14694 0 1 agncyis compstr 1117 2 0 0 0 evaluate highcost 7036 4 28144 0 0 eval

RE: [Perl-unix-users] Counting words

2006-04-26 Thread Matt Schneider
TED] [mailto:[EMAIL PROTECTED] On Behalf Of Sharp, CraigSent: Wednesday, April 26, 2006 7:44 AMTo: perl-unix-users@listserv.ActiveState.comSubject: [Perl-unix-users] Counting words I have a file that contains many li˜es.  Here is an example:evaluate eaprod  7844   2

Re: [Perl-unix-users] Counting words

2006-04-26 Thread Aleksandar Jelenak
I need to loop through and find the first word in each line and count the number of lines that contain this word in the first position. How about this: $ cat file-with-words | cut -d" " -f1 | sort | uniq -c -Aleksandar ___ Perl-Unix-Users ma

Re: [Perl-unix-users] Counting words

2006-04-26 Thread pDale
On 4/26/06, Sharp, Craig <[EMAIL PROTECTED]> wrote: I have a file that contains many li˜es.  Here is an example: evaluate eaprod  7844   2 15688 0 2 ... opncon   auditrec    8842   1  8842 0 1 I need to loo

Re: [Perl-unix-users] Counting words

2006-04-26 Thread $Bill Luebkert
Sharp, Craig wrote: > I have a file that contains many li˜es. Here is an example: > > evaluate eaprod 7844 2 15688 0 > 2 > evaluate agncyis 7347 2 14694 0 > 1 > agncyis compstr 1117

[Perl-unix-users] Counting words

2006-04-26 Thread Sharp, Craig
Title: Counting words I have a file that contains many li˜es.  Here is an example: evaluate eaprod  7844   2 15688 0 2 evaluate agncyis 7347   2 14694 0 1 agncyis  compstr 1117   2