Re: how to edit only one paragraph



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 .



Relevant Pages

  • Re: In vi/vim delete lines
    ... I frequently delete to a mark. ... | A buffer containing lines is put only once, ... | If the last command before a `.' ... The basic meta-characters for the replacement pattern are `&' and `~'; ...
    (comp.unix.shell)
  • Re: Populat a NewRecord from Text boxes Revisited
    ... earlier post were a little wide of the mark. ... The Form has two text boxes ... I used a command button (the command button wizard, record operations,Add ... field (fldName in my example). ...
    (comp.databases.ms-access)
  • Re: Start up messed up ...
    ... Mark tried your advice:result netchwindsockreset_enter:not recognized as ... "Mark L. Ferguson" wrote: ... > the netsh command in SP2 can rebuild your Winsock. ... >> Daffodills in Trouble! ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Populat a NewRecord from Text boxes Revisited
    ... I am posting this question a second time because the responses to my earlier post were a little wide of the mark. ... I am using Access 2000 and I would like to make a data entry form with a two text boxes. ... I used a command button (the command button wizard, record operations,Add ... I have assumed that you have heeded previous advice to rename the Name field (fldName in my example). ...
    (comp.databases.ms-access)
  • Re: Fixing a registry permissions issue?
    ... Your saying to go into the Recovery console and perform the command as shown? ... "Mark L. Ferguson" wrote: ... I want to fix the other boot ...
    (microsoft.public.windowsxp.help_and_support)