9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: revcomninos@gmail.com
To: 9fans <9fans@9fans.net>
Subject: [9fans] Help with a sam cleanup script
Date: Wed, 21 Jul 2021 05:17:15 -0400	[thread overview]
Message-ID: <16268590350.573C31.33295@composer.9fans.topicbox.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

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. 


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T10b1d559ae7d981e-M81420cb8a514930c24cd6ad6
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 2333 bytes --]

             reply	other threads:[~2021-07-21  9:17 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21  9:17 revcomninos [this message]
2021-07-21  9:24 ` Rodrigo G. López
2021-07-21  9:24 ` Rob Pike
2021-07-21  9:28 ` umbraticus
2021-07-21 10:02   ` revcomninos
2021-07-21 10:19     ` umbraticus
2021-07-21 10:49       ` revcomninos
2021-07-21 18:36         ` revcomninos
2021-07-21 18:47           ` revcomninos
2021-07-21 20:40             ` Silas McCroskey
2021-07-21 20:41               ` Silas McCroskey
2021-07-22  9:51                 ` revcomninos
2021-07-21  9:52 ` Alexander Kapshuk
2021-07-21 10:09   ` umbraticus
2021-07-26 14:17     ` revcomninos
2021-07-26 21:07       ` ori
2021-07-27  3:07         ` Mark van Atten
2021-07-27  6:32           ` revcomninos
2021-07-27  6:33           ` revcomninos
2021-07-27 13:23           ` Iruatã Souza
2021-07-27 13:28             ` Mark van Atten
2021-07-27 13:39             ` kvik
2021-07-27 14:14               ` Jacob Moody
2021-07-28 11:25               ` Iruatã Souza
2021-08-03 15:04                 ` fwrm via 9fans
2021-08-03 16:29                   ` fwrm via 9fans
2021-08-03 16:30             ` revcomninos
2021-08-03 18:03               ` Charles Forsyth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16268590350.573C31.33295@composer.9fans.topicbox.com \
    --to=revcomninos@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).