@echo off & setlocal enableextensions

:: Edits classw.tmp (output from classw.inp). Revised 9/3/17. M.J. Dallwitz.

set "i=classw.tmp"
set "o=classw.txt"
if not exist %i% goto e-file

:: '/A' keeps only altered lines.
call jrepl "^# " "" /A /F %i% > 1.tmp
call jrepl "^#" " " /F 1.tmp > 2.tmp
call jrepl "/$" "" /F 2.tmp > %o%
exit /b %errorlevel%

:e-file
echo '%i%' not found. Run 'classw.inp' in Intkey.
exit /b 1