Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Counting the number of occurances of all paragraphs in a file

Expand Messages
  • Prateek Mathur
    Hi,        What will be normal means of counting? Simplify my home work a bit more. :) Prateek Mathur ... From: merlyn@stonehenge.com
    Message 1 of 3 , Jul 23, 2010
    • 0 Attachment
      Hi,
             What will be normal means of counting? Simplify my home work a bit more. :)

      Prateek Mathur

      --- 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@...>
      Cc: perl-beginner@yahoogroups.com
      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

      complete.



      If this didn't smell like homework, I'd finish it for you.



      --

      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>

      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]
    Your message has been successfully submitted and would be delivered to recipients shortly.