      SUBROUTINE MAIN
      LOGICAL*1 GETCH
      INTEGER NXTFIL
      LOGICAL*1 C
      INTEGER TABPOS, INT, ARGCT
      INTEGER COL, I, NEWCOL, TABS(400)
      CALL SETTAB(TABS)
      COL = 1
      ARGCT = 1
23000 IF(.NOT.(NXTFIL(ARGCT,INT) .NE. -1))GOTO 23001
23002 CONTINUE
      NEWCOL = COL
23005 IF(.NOT.(GETCH(C,INT) .EQ. 32))GOTO 23006
      NEWCOL = NEWCOL + 1
      IF(.NOT.(TABPOS(NEWCOL,TABS) .EQ. 1))GOTO 23007
      CALL PUTC(9)
      COL = NEWCOL
23007 CONTINUE
      GOTO 23005
23006 CONTINUE
23009 IF(.NOT.(COL .LT. NEWCOL))GOTO 23011
      CALL PUTC(32)
23010 COL = COL + 1
      GOTO 23009
23011 CONTINUE
      IF(.NOT.(C .EQ. -1))GOTO 23012
      IF(.NOT.(INT .NE. 1))GOTO 23014
      CALL CLOSE(INT)
23014 CONTINUE
      GOTO 23004
23012 CONTINUE
      CALL PUTC(C)
      IF(.NOT.(C .EQ. 10))GOTO 23016
      COL = 1
      GOTO 23017
23016 CONTINUE
      COL = COL + 1
23017 CONTINUE
23003 GOTO 23002
23004 CONTINUE
      GOTO 23000
23001 CONTINUE
      RETURN
      END
      INTEGER FUNCTION NXTFIL(ARGCT,INT)
      INTEGER GETARG, OPEN, ALLDIG
      INTEGER ARGCT, INT
      INTEGER FLAG
      LOGICAL*1 ABUF(40)
      DATA FLAG /0/
      INT = 1
23018 CONTINUE
      NXTFIL = GETARG(ARGCT,ABUF,40)
      IF(.NOT.(ABUF(1) .EQ. 63))GOTO 23021
      CALL ERROR(40Husage:  entab [<t1>...] [+<n>] [file...])
23021 CONTINUE
      IF(.NOT.(NXTFIL .EQ. -1))GOTO 23023
      GOTO 23020
23023 CONTINUE
      IF(.NOT.(ABUF(1) .EQ. 43 .OR. ALLDIG(ABUF) .EQ. 1))GOTO 23025
      GOTO 23019
23025 CONTINUE
      FLAG = FLAG + 1
      IF(.NOT.(ABUF(1) .EQ. 45 .AND. ABUF(2) .EQ. 0))GOTO 23027
      INT = 1
      GOTO 23020
23027 CONTINUE
      INT = OPEN(ABUF,1)
      IF(.NOT.(INT .NE. -3))GOTO 23029
      GOTO 23020
23029 CONTINUE
      CALL CANT(ABUF)
23030 CONTINUE
23028 CONTINUE
23019 ARGCT = ARGCT + 1
      GOTO 23018
23020 CONTINUE
      IF(.NOT.(FLAG .EQ. 0))GOTO 23031
      FLAG = 1
      NXTFIL = 0
23031 CONTINUE
      ARGCT = ARGCT + 1
      RETURN
      END
