the large file challenge

andu undo at cloud9.net
Fri Nov 8 22:47:01 EST 2002


--On Friday, November 08, 2002 19:15:59 -0800 Richard Gaskin 
<ambassador at fourthworld.com> wrote:


># !/usr/local/bin/mc
> on startup
>   put "/gig/tmp/log/xaa" into the_file
>   put url ("file:"&the_file) into the_text
>   put 0 into the_counter
>   put 1 into tPointer
>   --
>   repeat for each line this_line in the_text
>     get offset("mystic_mouse", the_text, tPointer)
>     if it = 0 then exit repeat
>     add 1 to the_counter
>     add it to tPointer
>   end repeat
>   put the_counter
> end startup

Here's my take considering "mystic_mouse" can occur only once on a line and 
loading 300MG into ram is not an issue:

on startup
   put url ("file:"&"/gig/tmp/log/xaa") into the_text
  put 0 into the_counter
  repeat for each line this_line in the_text
     get offset("mystic_mouse", this_line)
     if it is not 0 then add 1 to the_counter
   end repeat
   put the_counter
 end startup

...and I'm sure it could be improved.

>
>
> This is off the top of my head.  If it runs I'd be interested in how it
> compares.
>
> --
>  Richard Gaskin
>  Fourth World Media Corporation
>  Developer of WebMerge 2.0: Publish any database on any site
>  ___________________________________________________________
>  Ambassador at FourthWorld.com       http://www.FourthWorld.com
>  Tel: 323-225-3717                       AIM: FourthWorldInc
>
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>



Regards, Andu Novac



More information about the metacard mailing list