<HTML><FONT FACE=arial,helvetica><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2" STYLE="BACKGROUND-COLOR: #FFFFFF">All right... I tweaked a little more outside of email.<BR>
For accuracy in the case where "mystic_mouse" occurs multiple times on one line, uncomment the line: <BR>
"add offset(return, thisChunk, theOffset) to theOffset"<BR>
<BR>
This just skips to the next line whenever a match is found.<BR>
<BR>
This should run faster than my previous attempts:<BR>
<BR>
on startup<BR>
&nbsp;  ## initialize variables: try adjusting numLines<BR>
</FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2" STYLE="BACKGROUND-COLOR: #FFFFFF">&nbsp;  put "/gig/tmp/log/access_log" into the_file</FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2" STYLE="BACKGROUND-COLOR: #FFFFFF"><BR>
&nbsp;  put ($1*1024*1024) into chunkSize ## this is for MB<BR>
&nbsp;  put 0 into counter<BR>
&nbsp;  put FALSE into isEOF<BR>
&nbsp;  <BR>
&nbsp;  open file the_file<BR>
&nbsp;  <BR>
&nbsp;  repeat until (isEOF = TRUE)<BR>
&nbsp;&nbsp;&nbsp;  ## read the specified number of lines, check if we are at the end of the file<BR>
&nbsp;&nbsp;&nbsp;  read from file the_file for chunkSize<BR>
&nbsp;&nbsp;&nbsp;  put it into thisChunk<BR>
&nbsp;&nbsp;&nbsp;  put (the result = "eof") into isEOF<BR>
&nbsp;&nbsp;&nbsp;  <BR>
&nbsp;&nbsp;&nbsp;  ## count the number of matches in this chunk<BR>
&nbsp;&nbsp;&nbsp;  put offset("mystic_mouse", thisChunk) into theOffset<BR>
&nbsp;&nbsp;&nbsp;  repeat<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  add 1 to counter<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  get offset("mystic_mouse", thisChunk, theOffset)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (it = 0) then exit repeat<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  put theOffset + it + 12 into theOffset<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  ## add offset(return, thisChunk, theOffset) to theOffset<BR>
&nbsp;&nbsp;&nbsp;  end repeat<BR>
&nbsp;&nbsp;&nbsp;  <BR>
&nbsp;  end repeat<BR>
&nbsp;  <BR>
&nbsp;  close file the_file<BR>
<BR>
&nbsp;  put counter<BR>
end startup<BR>
<BR>
HTH.<BR>
Brian</FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2" STYLE="BACKGROUND-COLOR: #FFFFFF"></FONT></HTML>