        DIMENSION LPOS(8)
        CHARACTER*1 LEFT(40),TEST(3,7),DATA(70),BLANK
        CHARACTER*12 FILE
        CHARACTER*20 FILELIST,OUTFILE
        CHARACTER*40 RIGHT
        DATA TEST/'I','M','A','O','B','S','O','B','J','D','A','T',
     D    'T','I','M','E','X','P','R','E','G'/,BLANK/' '/
        DATA LPOS/1,6,21,33,46,61,66,71/
        WRITE (*,*) ' file with list of files?'
        READ (*,5000) FILELIST
        WRITE (*,*) ' output log file?'
        READ (*,5000) OUTFILE
 5000   FORMAT (A20)
        OPEN (UNIT=1,FILE=FILELIST,STATUS='OLD')
        OPEN (UNIT=8,FILE=OUTFILE)
    1   READ (1,5001,END=100) FILE
 5001   FORMAT (A12)
        OPEN (UNIT=2,FILE=FILE,STATUS='OLD',ACCESS='DIRECT',
     O    RECL=80)
        DO 2 K=1,70
    2   DATA(K)=BLANK
        I=1
    3   READ (2,REC=I) LEFT,RIGHT
        DO 6 J=1,8
        IF (LEFT(1).NE.TEST(1,J)) GOTO 5
        IF (LEFT(2).NE.TEST(2,J)) GOTO 5
        IF (LEFT(3).NE.TEST(3,J)) GOTO 5
        DO 4 K=6,40
        IF (LEFT(K).EQ.'''') GOTO 7
    4   CONTINUE
        GOTO 5
    7   L=LPOS(J)
        K=K+1
    8   DATA(L)=LEFT(K)
        K=K+1
        L=L+1
        IF (LEFT(K).EQ.'''') GOTO 6
        IF (L.LT.LPOS(J+1)) GOTO 8
    5   IF (LEFT(1).EQ.'E'.AND.LEFT(2).EQ.'N'.AND.LEFT(3).EQ.'D')
     I       GOTO 10
    6   CONTINUE
        I=I+1
        IF (I.LT.48) GOTO 3
   10   CLOSE (2)
        WRITE (*,7010) FILE,DATA
        WRITE (8,7010) FILE,DATA
 7010   FORMAT (A12,T9,' ',70A1)
        GOTO 1
  100   CLOSE (1)
        STOP
        END
