Text Processing Puzzle

Gregory Lypny gregory.lypny at videotron.ca
Fri Jul 17 11:42:45 EDT 2009


	Hello Kee and Pierre,

	Thank you for your thoughts.  My response is below.

		Gregory


On Fri, Jul 17, 2009, at 11:05 AM, Kee Nethery wrote:

> Message: 9
> Date: Thu, 16 Jul 2009 14:43:44 -0700
> From: Kee Nethery <kee at kagi.com>
> Subject: Re: Text Processing Puzzle
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <907B3214-6319-43EC-959A-C30600E4EBDE at kagi.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> unicode?
>
> On Jul 16, 2009, at 2:32 PM, Gregory Lypny wrote:
>
>> What am I missing here?
>


	Kee, I've never had occasion to use unicode yet.  Would you elaborate  
a little please?



On Fri, Jul 17, 2009, at 11:05 AM, Pierre Sahores wrote:

> Message: 14
> Date: Fri, 17 Jul 2009 10:48:36 +0200
> From: Pierre Sahores <psahores at free.fr>
> Subject: Re: Text Processing Puzzle
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <02280324-CCDF-4CC0-9079-1C429F5105B3 at free.fr>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
>
> Hi Gregory,
>
> Is the filesize var well reinited to "0" at the begining of each new
> year stories parsing ?


	Pierre, not sure what you mean here.  Because they are big, each file  
is read separately.  I don't tally the size of what I've read in; I  
just look for an end-of-file result, save my index, and delete a big  
local variable called outputRecords.

---The guts of my file reading script---

    repeat
       read from file inputFile until "Canada NewsWire"
       put the result into resultOfRead  -- Check for eof

       --Clean line feeds
       replace crlf with return in it
       replace numToChar(13) with return in it

       if resultOfRead is not empty and \
              ("Canada NewsWire" is not in it or the number of lines  
in it <= 5)
       then
          put outputRecords after url ("File:" & outputFile)
          delete local outputRecords
          exit repeat
       else
          -- The next one skips "Canada NewsWire" in the copyright  
statement on the eighth line.
          if the number of lines in it <= 5 and resultOfRead is empty  
then next repeat
       end if

	-- Process the contents of the headline and story here.

>
> Best,
> --
> Pierre Sahores



More information about the use-livecode mailing list