Re: how to edit only one paragraph
- From: Michael Tosch <eedmit@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 05 Jan 2006 20:58:54 +0100
angel wrote:
HI, Thanks for the reply.
I have a question for Sashi, I did want to use VI to do it..
But I don't know how to use VI to specify a range..
If you could tell me the detail , I would be appreciated.
Thanks
Sashi wrote:
Using VI you can specify a range of lines to modify for the editing command that you use such that your changes are only updated to the paragraph you're interested in. Sashi
Janis Papanagnou wrote:
angel wrote:
HI,
I want to do some global change in one paragraph of my file.
Define "global change". Define "paragraph".
Provide sample data.
Is there any way to do that?
Thanks.
I know the following block delimiters for the : commands
.. (dot) the current line 1 the first line n the nth line $ the last line $-1 the second last line 'a the mark a 'n the mark n 'n+1 the line after mark n
Now go to the beginning of your block, do
ma
and you have set the mark a. Then go to the end of your block, and do the substitute command between the mark a and the current line
:'a,. s/oldstring/newstring/g
/g (global) means multiple matches within a line are all substituted.
The command :u undoes your change.
-- Michael Tosch @ hp : com .
- Follow-Ups:
- Re: how to edit only one paragraph
- From: angel
- Re: how to edit only one paragraph
- References:
- how to edit only one paragraph
- From: angel
- Re: how to edit only one paragraph
- From: Janis Papanagnou
- Re: how to edit only one paragraph
- From: Sashi
- Re: how to edit only one paragraph
- From: angel
- how to edit only one paragraph
- Prev by Date: Script endlessly looping
- Next by Date: Re: Can I see in a telnet session remote tty1
- Previous by thread: Re: how to edit only one paragraph
- Next by thread: Re: how to edit only one paragraph
- Index(es):
Relevant Pages
|