<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>
## initialize variables: try adjusting numLines<BR>
</FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2" STYLE="BACKGROUND-COLOR: #FFFFFF"> put "/gig/tmp/log/access_log" into the_file</FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2" STYLE="BACKGROUND-COLOR: #FFFFFF"><BR>
put ($1*1024*1024) into chunkSize ## this is for MB<BR>
put 0 into counter<BR>
put FALSE into isEOF<BR>
<BR>
open file the_file<BR>
<BR>
repeat until (isEOF = TRUE)<BR>
## read the specified number of lines, check if we are at the end of the file<BR>
read from file the_file for chunkSize<BR>
put it into thisChunk<BR>
put (the result = "eof") into isEOF<BR>
<BR>
## count the number of matches in this chunk<BR>
put offset("mystic_mouse", thisChunk) into theOffset<BR>
repeat<BR>
add 1 to counter<BR>
get offset("mystic_mouse", thisChunk, theOffset)<BR>
if (it = 0) then exit repeat<BR>
put theOffset + it + 12 into theOffset<BR>
## add offset(return, thisChunk, theOffset) to theOffset<BR>
end repeat<BR>
<BR>
end repeat<BR>
<BR>
close file the_file<BR>
<BR>
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>