Re: [PBML] Counting the number of occurances of all paragraphs in a file
What will be normal means of counting? Simplify my home work a bit more. :)
--- On Tue, 7/20/10, merlyn@... <merlyn@...> wrote:
From: merlyn@... <merlyn@...>
Subject: Re: [PBML] Counting the number of occurances of all paragraphs in a file
To: "Prateek Mathur" <hiprateek007@...>
Date: Tuesday, July 20, 2010, 8:02 PM
>>>>> "Prateek" == Prateek Mathur <hiprateek007@...> writes:
Prateek> Let me know how can I do this Perl. I came across the split
Prateek> function but then that has to be used for every paragraphs and
Prateek> the text file can be very big as well to store in a single
Prateek> array. Also many paragraphs will appear only once which are
Prateek> not to be considered.
Set the value of $/ to "", then your filehandle reads will automatically
be broken into paragraphs. Using the normal means of counting, you can
then count each paragraph, and deliver a summary once the reading is
If this didn't smell like homework, I'd finish it for you.
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
[Non-text portions of this message have been removed]