      program nocr      ! no carraige return

c this is an attempt to remove ^M from end of line

      character*100 record, outrec
      character*80 infile, getunx
      character*6 chival
      logical eor

      call chekcl ('|     :r:1:Input_file'
     2           //'|')
      infile = getunx(' ',1,lenin)
      call opstyb (8, 'old', 'formatted', 'list', 0, infile(:lenin),
     2 ios)
      if (ios .ne. 0) call abort
     2 ('Unable to open input file '//chival(ios))
      call opstyb
     2      (9, 'new', 'formatted', 'list', 0, infile(:lenin-1)//'n',
     2 ios)
      if (ios .ne. 0)
     2         call abort ('Unable to open output file'//chival(ios))
      kr = 0
      do while (ios .eq. 0)
        read (8, '(a)', iostat=ios) record
        if (ios .eq. 0) then
          kr = kr + 1
          lenrec = len_trim (record)
          if (lenrec .ne. 0) then
            if (record(lenrec:lenrec) .eq. char(13)) lenrec = lenrec - 1
          end if
          if (lenrec .eq. 0) then
            write (9, '(a)')
          else
            call untab (record(:lenrec), outrec)
            write (9, '(a)') outrec(:len_trim(outrec))
          end if
        end if
      end do
      if (ios .ne. -1) call abort ('I/O error at eof?'//chival(ios))
      close (unit=8)
      if (.not.eor) close (unit=9)
      stop
      end      
