9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Rudolf Sykora <rudolf.sykora@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] sam command language question
Date: Mon, 20 Aug 2012 13:55:25 +0200	[thread overview]
Message-ID: <CAOEdRO0+AxHh2GX-pCb=e4bCSrgt=xEmLXZPK1AVdFAAYKE8Xw@mail.gmail.com> (raw)
In-Reply-To: <0813ca81b8948388dfca9fed6467e9a7@quintile.net>

On 20 August 2012 13:12, Steve Simon <steve@quintile.net> wrote:
> Tis the season for exotic sam command language questions,
> though mine is not that exotic.
>
> I want to edit some xml (yes I know) and capitalise all the labels
> in it. I only want to do this once so I don't care that it will
> envoke tr thousands of times and take a minuite or so.
>
> This is what I tried:
>
>         ,x/label="[^"]+"/ {
>                 x/ [a-z]/ | tr a-z A-Z
>         }
>
> sadly the inner 'x' searches onward in the file and not in
> the selection (dot) generated by the outer 'x'.
>
> I tried a few more random commands but nothing very sensible,
> anyone any ideas?
>
> Seems somthing that should be easy...
>
> -Steve
>

1) what's wrong with
,x/label="[^"]+"/ | tr a-z A-Z
?
(besides that it also capitalizes label -> LABEL; but this would do
your code too)

2) I will think about your own code later.

Ruda



  reply	other threads:[~2012-08-20 11:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-20 11:12 Steve Simon
2012-08-20 11:55 ` Rudolf Sykora [this message]
2012-08-20 12:05 ` Rudolf Sykora
2012-08-20 12:15 ` Rudolf Sykora
2012-08-20 12:25   ` Steve Simon
2012-08-20 13:21     ` Rudolf Sykora

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='CAOEdRO0+AxHh2GX-pCb=e4bCSrgt=xEmLXZPK1AVdFAAYKE8Xw@mail.gmail.com' \
    --to=rudolf.sykora@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).