9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Help with a sam cleanup script
@ 2021-07-21  9:17 revcomninos
  2021-07-21  9:24 ` Rodrigo G. López
                   ` (3 more replies)
  0 siblings, 4 replies; 28+ messages in thread
From: revcomninos @ 2021-07-21  9:17 UTC (permalink / raw)
  To: 9fans

[-- 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 --]

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2021-08-03 18:03 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21  9:17 [9fans] Help with a sam cleanup script revcomninos
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

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).