From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <0813ca81b8948388dfca9fed6467e9a7@quintile.net> References: <0813ca81b8948388dfca9fed6467e9a7@quintile.net> Date: Mon, 20 Aug 2012 13:55:25 +0200 Message-ID: From: Rudolf Sykora To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] sam command language question Topicbox-Message-UUID: aca2824e-ead7-11e9-9d60-3106f5b1d025 On 20 August 2012 13:12, Steve Simon 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