Just for the record, the following command works for me. (I deleted the "\<" because it seemed to stop the command having the desired effect, and I wasn't sure what it was meant to be doing. I also had to delete the space after REM because some of my REMs weren't followed by a space. (Naughty, naughty.)):SteveF wrote: ↑Mon Sep 06, 2021 7:01 pm The ultimate crude hack in an emergency - which would not treat quoted strings specially, but you'd probably get away with it - would just be to do something like:Code: Select all
sed -e 's/\<REM .*//g' mybigfile.txt | basictool -t - out.tok
Code: Select all
sed -e 's/REM.*//g' -e '/^$/d' mybigfile.txt | basictool -p -t -r -v -v - out.tok
As you said, this is just a crude hack in case of emergency because, I think, it will delete every instance of "REM", plus everything up to the end of the line, no matter where exactly the string "REM" appears. So it'll play merry hell with this, for example:
Code: Select all
PRINT"Hello"
PROCTHEOREM
END
DEFPROCTHEOREM:PRINT "Goodbye"
ENDPROC