Re: [9fans] sam language question

2010-04-23 Thread Rudolf Sykora
On 23 April 2010 00:04, roger peppe rogpe...@gmail.com wrote:
 another way (and how i would usually do it):

 ,x g/0\.00/i/\n/


Oh yes, that's probably the best.+- is really unnecessary in this case.
Thanks
R



Re: [9fans] sam language question

2010-04-22 Thread Rob Pike
,x/0\.00/-a/\n/

-rob



Re: [9fans] sam language question

2010-04-22 Thread yy
2010/4/22 Rudolf Sykora rudolf.syk...@gmail.com:
 Hello,

 I have a file in which I wanted to insert an empty line just before
 any line on which a string, say '0.00' is present.


Edit ,x/^.*0\.00/i/\n/

-- 
- yiyus || JGL . 4l77.com



Re: [9fans] sam language question

2010-04-22 Thread Rudolf Sykora
On 22 April 2010 20:21, Rob Pike robp...@gmail.com wrote:
 ,x/0\.00/-a/\n/

 -rob


ok. this works. But what is wrong with mine?!
thanks!
Ruda



Re: [9fans] sam language question

2010-04-22 Thread Rudolf Sykora
On 22 April 2010 20:24, yy yiyu@gmail.com wrote:
 Edit ,x/^.*0\.00/i/\n/

The same answer as to Rob Pike. Your solution is ok, thanks. But I
still can't see what's wrong with mine... :(
R



Re: [9fans] sam language question

2010-04-22 Thread Rudolf Sykora
On 22 April 2010 21:28, yy yiyu@gmail.com wrote:
 You would need to group your last commands (think carefuly about it):

 ,x/0.00/{+-i/\n/
 }

 but then you would have to type a bit more.

I don't know how it could happen, by the problem I had with
,x/0.00/+-i/\n/
is that it should have been
,x/0\.00/+-i/\n/
Now it does the job. (i.e. just a missing \)

Finally, to add just one line in case there are more '0.00's on a line:
,x g/0\.00/-a/\n/
is fine as well as
,x g/0\.00/+-i/\n/

Thanks and sorry for the noise.
Ruda



Re: [9fans] sam language question

2010-04-22 Thread roger peppe
another way (and how i would usually do it):

,x g/0\.00/i/\n/


On 22 April 2010 18:32, Rudolf Sykora rudolf.syk...@gmail.com wrote:
 Hello,

 I have a file in which I wanted to insert an empty line just before
 any line on which a string, say '0.00' is present.

 My attempts to do it this way:
 ,x/0.00/+-i/\n/
 or similarly were not succesful.

 I am not sure where the problem is exactly. (Only have some feeling
 about it, but couldn't find anything authorative...)

 Can somebody help?

 Thanks
 Ruda