I finally get around to trying this out and (so far) it seems to work.
Thank you!
You're welcome!
Opening the group at the end of the first line has the effect of
replacing the empty command and its implied p; see sam's man page
under `Miscellany'. This also explains why your lines, without
On 31 October 2013 20:24, Rudolf Sykora rudolf.syk...@gmail.com wrote:
On 31 October 2013 16:49, Friedrich Psiorz f.psi...@gmx.de wrote:
It works for me, but I found another inconsistency.
I tried it on p9p and 9vx, both in acme and sam.
/A/+#0;/B/-#0
g/CC/ s/CC/DD/g
p
Well. If I use
What if you specify the address twice like this:
/A/+#0;/B/-#0g/CC/ s/CC/DD/g
/A/+#0;/B/-#0p
That doesn't work if A and B occur more than once in the file or if DD matches
A or B. But otherwise, it seems to work for me.
Micah
On Nov 6, 2013, at 10:47 AM, Rudolf Sykora wrote:
On 31 October
I write the script like this:
/A/+#0;/B/-#0 {
g/CC/ s/CC/DD/g
}
p
Mark.
On Wed, Nov 6, 2013 at 7:47 PM, Rudolf Sykora rudolf.syk...@gmail.com wrote:
On 31 October 2013 20:24, Rudolf Sykora rudolf.syk...@gmail.com wrote:
On 31 October 2013 16:49, Friedrich Psiorz f.psi...@gmx.de wrote:
It
It works for me, but I found another inconsistency.
I tried it on p9p and 9vx, both in acme and sam.
9vx acme is different form the others, for some reason. It does print
the string between A and B, but prints it with CC and not with DD like
sam and like p9p acme.
~Fritz
Am 31.10.2013 16:21,
On 29 October 2013 17:56, Friedrich Psiorz f.psi...@gmx.de wrote:
this should do the trick
/A/+#0;/B/-#0
g/CC/ s/CC/DD/g
p
Thanks for the suggestion, the g construct didn't come to my mind.
However, it doesn't work for me: again, if CC is there, it works;
if it's not, then the final dot only
Hello,
how can I set a dot from after A to before B, then make a global
substitution, within thus set dot, of CC to DD and print the resulting
text?
I.e., if there isn't any CC between A and B, just print what's between
A and B, if there is, change it to DD and print all between A and B.
I have
this should do the trick
/A/+#0;/B/-#0
g/CC/ s/CC/DD/g
p
~Fritz
Am 29.10.2013 16:31, schrieb Rudolf Sykora:
Hello,
how can I set a dot from after A to before B, then make a global
substitution, within thus set dot, of CC to DD and print the resulting
text?
I.e., if there isn't any CC