PROC MAIN
String LINE1
Set Capture Overwrite OFF
Set capture file "mainfile.cap"; I used a date driven name
capture ON
WHILE 1 ;loops forever
Waitfor "ACD" forever ;Waiting for report
Waitquiet 300 ;5 minutes after report is done running
capture off
fopen 0 "mainfile.cap" read text ;you may have to play
;with the directory setting
While not feof 0
fgets 0 LINE1
if strfind LINE1 "SEQUENCE #" ;review your own reports
; to find an appropriate trigger
fopen 1 "temptext.txt" readwrite text
fputs 1 LINE1
while not feof 0 ; This is a nested loop
; that will look for the end of the report
fgets 0 LINE1
if strfind LINE1 "TOTAL" ; if you do not have one
; single trigger avail, use elseif
fputs 1 LINE1
exitwhile; Exits the nested loop only
else
fputs 1 LINE1
Endif
Endwhile; Ends nested loop
Endif ;End of "SEQUENCE #" if statement
Fclose 1 ;Closes the temptext.txt file
Set Print Orientation Landscape
Printcapture ON
Playback "Temptext.txt"
While $Playback
Yield
EndWhile
Pause 5
Printcapture OFF
Delfile "temptext.txt" ;Delete after printing
Endwhile; End of processing the file.
ENDWHILE; End of While 1 statement - will loop back for next report set.
ENDPROC