      REM PLW-REBUILD-LOG
*PIC-LAN
*
*ALL
*PC
*Y
*
*
*
*
******************************************************************************
******************************************************************************
***                                                                        ***
*** (C) Copyright 1990-2005 Doug Dumitru, All Rights Reserved.             ***
***                                                                        ***
*** This program is licensed under the terms of the GNU General Public     ***
*** License, version 2.0 with attached notices.                            ***
***                                                                        ***
*** The full text can be found in the LICENSE.TXT file in the              ***
*** PLIP.BP database file (the /usr/qmweb/PLIP.BP/PLIP.BP directory).      ***
***                                                                        ***
******************************************************************************
******************************************************************************
*
      INCLUDE SYS.TYPE.INCLUDE
*
      OPEN 'WWW.LOG' TO LOG.FD ELSE CALL PLXX.STOP(201,'WWW.LOG')
      OPEN 'WWW.LOG,BY.FNAME' TO FNAME.FD ELSE CALL PLXX.STOP(201,'WWW.LOG,BY.FNAME')
      OPEN 'WWW.LOG,BY.IP' TO IP.FD ELSE CALL PLXX.STOP(201,'WWW.LOG.BY.IP')
      OPEN 'WWW.LOG,USAGE' TO USAGE.FD ELSE CALL PLXX.STOP(201,'WWW.LOG,USAGE')
*
      CLEARFILE FNAME.FD
      CLEARFILE IP.FD
*
      SELECT LOG.FD
      EOF = NO
      COUNTER = 0
      LOOP
         READNEXT ID ELSE EOF = YES
      UNTIL EOF DO
         READ D FROM LOG.FD , ID THEN
            PL_READU DD FROM FNAME.FD , D<5> ELSE DD = ''
            DD<1> = DD<1> + 1
            WRITE DD ON FNAME.FD , D<5>
            PL_READU DD FROM IP.FD , FIELD(D<4>,':',1) ELSE DD = ''
            DD<1> = DD<1> + 1
            WRITEU DD ON IP.FD , FIELD(D<4>,':',1)
         END
         COUNTER = COUNTER + 1
         PRINT COUNTER : CR :
      REPEAT
   END
