9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Rodrigo G. López" <rodrigosloop@gmail.com>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] Help with a sam cleanup script
Date: Wed, 21 Jul 2021 11:24:25 +0200	[thread overview]
Message-ID: <CA+cCjXpTctv-4eXFLpjPLtQ83sZNM=kPr3-e-8uOBFTdG1tyaQ@mail.gmail.com> (raw)
In-Reply-To: <16268590350.573C31.33295@composer.9fans.topicbox.com>

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

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.
>
>
> *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
> <https://9fans.topicbox.com/groups/9fans> + participants
> <https://9fans.topicbox.com/groups/9fans/members> + delivery options
> <https://9fans.topicbox.com/groups/9fans/subscription> Permalink
> <https://9fans.topicbox.com/groups/9fans/T10b1d559ae7d981e-M81420cb8a514930c24cd6ad6>
>

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

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

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

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21  9:17 revcomninos
2021-07-21  9:24 ` Rodrigo G. López [this message]
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='CA+cCjXpTctv-4eXFLpjPLtQ83sZNM=kPr3-e-8uOBFTdG1tyaQ@mail.gmail.com' \
    --to=rodrigosloop@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).