try with ssam(1).

% ssam -f thatscriptofyours somefile


-rodri

On Wed, Jul 21, 2021, 11:17 AM <revcomninos@gmail.com> wrote:
In ed I have a cleanup script which I can apply to several files at once. The script removes things like blank lines and spaces between words. To run it on a file or multiple files, I type this command:
ed [name of file(s)] < cleanup-script
I converted all the regular expressions in the file into sam regex format and tried the same, but to no avail.  Here is a list of some of the commands:
.x s/\*//g
,x/^ +/s///
,x/ +$/s///
,x/  +/s// /
,x/^$\n/d
,x/‘‘|’’/s//"/
,x/“|”/s//"/
,x/‘|’/s//"/
,x/^ +/s///
,x/ +$/s///
,x/  +/s// /
,x/^$\n/d
,x/‘‘|’’/s//"/
,x/“|”/s//"/
,x/‘|’/s//"/
,x/teh/c/the/
wq
I am not even sure sam can do this, but if it can, I would appreciate some guidance on how to do it.