Counting Word Occurances
am 15.07.2011 17:58:01 von matt
I have a file with lines like so but the number of them is in the
thousands instead of seven lines:
blue
red
red
red
orange
orange
green
I want it to count the occurances of each word it finds in the file.
So output on this small file would be:
blue (1)
red (3)
orange (2)
green (1)
The contents of the file are sorted already. Any ideas how to do this? Thanks.
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/
Re: Counting Word Occurances
am 15.07.2011 18:01:32 von Shawn H Corey
--------------010003090307010906000606
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
On 11-07-15 11:58 AM, Matt wrote:
> The contents of the file are sorted already. Any ideas how to do this? Thanks.
Yes, see attached.
--
Just my 0.00000002 million dollars worth,
Shawn
Confusion is the first step of understanding.
Programming is as much about organization and communication
as it is about coding.
The secret to great software: Fail early & often.
Eliminate software piracy: use only FLOSS.
--------------010003090307010906000606
Content-Type: text/plain;
name="freq"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="freq"
IyEvdXNyL2Jpbi9lbnYgcGVybAojIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0t
LS0tLS0tCiMgbmFtZSAgICAgICAgICAgOiBmcmVxCiMgZGVzY3JpcHRpb24g ICAgOiBDb3Vu
dCB0aGUgaXRlbXMuCiMgaW52b2NhdGlvbiAgICAgOiBmcmVxIFstLWhlbHBd IFstLVtub11y
ZXZlcnNlXSBbLS1bbm9daWdub3JlY2FzZV0gWy0tKGNvdW50fGFscGhhYmV0 aWNhbGx5KV0g
WzxmaWxlPl0gLi4uCiMgb3B0aW9ucyAgICAgICAgOiAtLWhlbHAgICAgICAg ICAgICAgICAg
ICAgLS0gUHJpbnQgdGhlIGhlbHAgdGV4dC4KIyAgICAgICAgICAgICAgICAg IC0tW25vXXJl
dmVyc2UgICAgICAgICAgICAtLSBSZXZlcnNlIHRoZSBvcmRlciBvZiB0aGUg c29ydC4KIyAg
ICAgICAgIC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tcGxlcyAgICAg ICA6IE5BCiMg
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0Kc3ViIHNo b3cgewogIG15
IEBzb3J0ZWQgPSAoKTsKICBpZiggJEJ5Q291bnQgKXsKICAgIGlmKCAkSWdu b3JlY2FzZSAp
ewogICAgICBpZiggJFJldmVyc2UgKXsKICAgICAgICBAc29ydGVkID0gbWFw eyAkXy0+WzBd
IH0KICAgICAgICAgICAgICAgICAgc29ydHsKICAgICAgICAgICAgICAgICAg ICAkYi0+WzFd
IDw9PiAkYS0+WzFdCiAgICAgICAgICAgICAgICAgICAgfHwgJGItPlsyXSBj bXAgJGEtPlsy
XQogICAgICAgICAgICAgICAgICAgIHx8ICRiLT5bMF0gY21wICRhLT5bMF0K ICAgICAgICAg
ICAgICAgICAgfQogICAgICAgICAgICAgICAgICBtYXB7WyAkXywgJEl0ZW1z eyAkXyB9LCBs
YyggJF8gKV19CiAgICAgICAgICAgICAgICAgIGtleXMgJUl0ZW1zOwogICAg ICB9ZWxzZXsK
ICAgICAgICBAc29ydGVkID0gbWFweyAkXy0+WzBdIH0KICAgICAgICAgICAg ICAgICAgc29y
dHsKICAgICAgICAgICAgICAgICAgICAkYS0+WzFdIDw9PiAkYi0+WzFdCiAg ICAgICAgICAg
ICAgICAgICAgfHwgJGEtPlsyXSBjbXAgJGItPlsyXQogICAgICAgICAgICAg ICAgICAgIHx8
ICRhLT5bMF0gY21wICRiLT5bMF0KICAgICAgICAgICAgICAgICAgfQogICAg ICAgICAgICAg
ICAgICBtYXB7WyAkXywgJEl0ZW1zeyAkXyB9LCBsYyggJF8gKV19CiAgICAg ICAgICAgICAg
ICAgIGtleXMgJUl0ZW1zOwogICAgICB9CiAgICB9ZWxzZXsKICAgICAgaWYo ICRSZXZlcnNl
ICl7CiAgICAgICAgQHNvcnRlZCA9IG1hcHsgJF8tPlswXSB9CiAgICAgICAg ICAgICAgICAg
IHNvcnR7CiAgICAgICAgICAgICAgICAgICAgJGItPlsxXSA8PT4gJGEtPlsx XQogICAgICAg
ICAgICAgICAgICAgIHx8ICRiLT5bMF0gY21wICRhLT5bMF0KICAgICAgICAg ICAgICAgICAg
fQogICAgICAgICAgICAgICAgICBtYXB7WyAkXywgJEl0ZW1zeyAkXyB9XX0K ICAgICAgICAg
ICAgICAgICAga2V5cyAlSXRlbXM7CiAgICAgIH1lbHNlewogICAgICAgIEBz b3J0ZWQgPSBt
YXB7ICRfLT5bMF0gfQogICAgICAgICAgICAgICAgICBzb3J0ewogICAgICAg ICAgICAgICAg
ICAgICRhLT5bMV0gPD0+ICRiLT5bMV0KICAgICAgICAgICAgICAgICAgICB8 fCAkYS0+WzBd
IGNtcCAkYi0+WzBdCiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAg ICAgICAgbWFw
e1sgJF8sICRJdGVtc3sgJF8gfV19CiAgICAgICAgICAgICAgICAgIGtleXMg JUl0ZW1zOwog
ICAgICB9CiAgICB9CiAgfWVsc2V7CiAgICBpZiggJElnbm9yZWNhc2UgKXsK ICAgICAgaWYo
ICRSZXZlcnNlICl7CiAgICAgICAgQHNvcnRlZCA9IG1hcHsgJF8tPlswXSB9 CiAgICAgICAg
ICAgICAgICAgIHNvcnR7CiAgICAgICAgICAgICAgICAgICAgJGItPlsxXSBj bXAgJGEtPlsx
XQogICAgICAgICAgICAgICAgICAgIHx8ICRiLT5bMF0gY21wICRhLT5bMF0K ICAgICAgICAg
ICAgICAgICAgfQogICAgICAgICAgICAgICAgICBtYXB7WyAkXywgbGMoICRf ICldfQogICAg
ICAgICAgICAgICAgICBrZXlzICVJdGVtczsKICAgICAgfWVsc2V7CiAgICAg ICAgQHNvcnRl
ZCA9IG1hcHsgJF8tPlswXSB9CiAgICAgICAgICAgICAgICAgIHNvcnR7CiAg ICAgICAgICAg
ICAgICAgICAgJGEtPlsxXSBjbXAgJGItPlsxXQogICAgICAgICAgICAgICAg ICAgIHx8ICRh
LT5bMF0gY21wICRiLT5bMF0KICA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QgaXMgdG8gc29ydCB1cHBlcmNhc2UgYmVm b3JlIGxvd2Vy
Y2FzZS4KCj1pdGVtIC0tKGNvdW50fGFscGhhYmV0aWNhbGx5KQoKU29ydCBv dXRwdXQgYnkg
Y291bnQgb2YgaXRlbXMgb3IgYWxwaGFiZXRpY2FsbHkgYnkgaXRlbS4KRGVm YXVsdCBpcyBh
bHBoYWJldGljYWxseS4KCj1iYWNrCgo9aGVhZDEgREVTQ1JJUFRJT04KCj1o ZWFkMSBFTlZJ
Uk9OTUVOVAoKPW92ZXIgNAoKPWl0ZW0gRlJFUQoKVGhpcyB2YXJpYWJsZSBh bGxvd3MgdGhl
IHVzZXIgdG8gY2hhbmdlIGhpcy9oZXIgZGVmYXVsdCBvcHRpb25zLgoKPWJh Y2sKCj1oZWFk
MSBGSUxFUwoKPWhlYWQxIFJFVFVSTiBWQUxVRQoKPWhlYWQxIEVSUk9SUwoK PWhlYWQxIEVY
QU1QTEVTCgo9aGVhZDEgU0VFIEFMU08KCj1oZWFkMSBTVEFOREFSRFMKCj1o ZWFkMSBCVUdT
Cgo9aGVhZDEgSElTVE9SWQoKPW92ZXIgNAoKPWl0ZW0gT24gMjAwNC0wMS0y NAoKQ3JlYXRl
ZCB2ZXJzaW9uIDMuMDEuCgo9YmFjawoKPWhlYWQxIE5PVEVTCgo9Y3V0Cgo=
--------------010003090307010906000606
Content-Type: text/plain; charset=us-ascii
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/
--------------010003090307010906000606--
Re: Counting Word Occurances
am 15.07.2011 18:04:19 von jbiskofski
--001636c5abd75afe4504a81dcdf7
Content-Type: text/plain; charset=ISO-8859-1
my %words;
while (<>) {
# read input line by line...
# remove trailing new line
chomp;
my $word = $_;
$words{$word}++;
}
foreach my $word (sort keys %words) {
print "$word ($words{$word})\n";
}
------
you can run the script like this : cat file.txt | perl script.pl
It can be a lot shorter but I tried to write verbosely so you could
experiment.
cheers.
- jose biskofski
On Fri, Jul 15, 2011 at 10:58 AM, Matt wrote:
> I have a file with lines like so but the number of them is in the
> thousands instead of seven lines:
>
> blue
> red
> red
> red
> orange
> orange
> green
>
> I want it to count the occurances of each word it finds in the file.
> So output on this small file would be:
>
> blue (1)
> red (3)
> orange (2)
> green (1)
>
> The contents of the file are sorted already. Any ideas how to do this?
> Thanks.
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>
--001636c5abd75afe4504a81dcdf7--
Re: Counting Word Occurances
am 16.07.2011 07:00:05 von Rob Dixon
On 15/07/2011 16:58, Matt wrote:
> I have a file with lines like so but the number of them is in the
> thousands instead of seven lines:
>
> blue
> red
> red
> red
> orange
> orange
> green
>
> I want it to count the occurances of each word it finds in the file.
> So output on this small file would be:
>
> blue (1)
> red (3)
> orange (2)
> green (1)
>
> The contents of the file are sorted already. Any ideas how to do this? Thanks.
Hi Matt
A call to split() can be very useful for quickly stripping leading and
trailing whitespace (including any terminating newline) even if there is
onlt a single field in each record.
The program below uses this in a solution to your problem, but if you
need to maintain the order of the words in the original file then
something more will be needed.
HTH,
Rob
use strict;
use warnings;
my %count;
while () {
$count{$_}++ foreach split;
}
print "$_ ($count{$_})\n" foreach keys %count;
__DATA__
blue
red
red
red
orange
orange
green
**OUTPUT**
green (1)
blue (1)
orange (2)
red (3)
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/
Re: Counting Word Occurances
am 16.07.2011 12:09:33 von rvtol+usenet
On 2011-07-15 17:58, Matt wrote:
> I have a file with lines like so but the number of them is in the
> thousands instead of seven lines:
>
> blue
> red
> red
> red
> orange
> orange
> green
>
> I want it to count the occurances of each word it finds in the file.
> So output on this small file would be:
>
> blue (1)
> red (3)
> orange (2)
> green (1)
>
> The contents of the file are sorted already. Any ideas how to do this? Thanks.
With the numbers in front:
uniq -c file
I often use:
... |sort |uniq -c |sort -rn
to analyze some output.
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/