Break ON
$=SetOption("Explicit","ON")
Dim $sSource,$asPages,$iPageCount,$sSentinelText,$iIndex,$asLines
$sSource=".\findme.txt"
$sSentinelText="Findme"
$asPages=LoadFile($sSource,Chr(12))
For $iPageCount=0 to UBound($asPages)
"Working on page # "+(1+$iPageCount)+@CRLF
$iIndex=InStr($asPages[$iPageCount],$sSentinelText)
If Not $iIndex " String '"+$sSentinelText+"' not found on page"+@CRLF EndIf
While $iIndex
$asPages[$iPageCount]=SubStr($asPages[$iPageCount],$iIndex+Len($sSentinelText))
$asLines=Split($asPages[$iPageCount]+@CRLF+@CRLF+@CRLF,@CRLF)
If (""+$asLines[2]+$asLines[3])=""
" String '"+$sSentinelText+"' found on page, but no data present"+@CRLF
Else
" First code : "+Split($asLines[2])[0]+@CRLF
" Second code: "+Split($asLines[3])[0]+@CRLF
EndIf
$iIndex=InStr($asPages[$iPageCount],$sSentinelText)
Loop
Next