here is a snippet...

code:
  
IF Open(1,"c:\sync-c.log") = 0
Endif
$line = Readline(1)
WHILE @ERROR = 0
$line = Readline(1)
IF substr($line,1,8)='sending '
$prevline=$line
$line=substr($line,9)
$dot=instr($line,'.')
$line=substr($line,1,$dot + 3)
$sentfile=$line
$line5 = Readline(1) <--Returns a blank line

if substr($line5,1,11)='FAILED SEND' $failfile=$sentfile

The idea is to loop through the file (the loop command is in the full code).