Thanks a lot Pratik.

From: Pratik Vyas <[email protected]>
Sent: Sun, 26 Jan 2014 16:08:24 
To: "GNU/Linux Users Group, Mumbai, India" <[email protected]>
Subject: Re: [ILUG-BOM] [OT] Help on Vi Command
Hi Joel,





On Sun, Jan 26, 2014 at 3:57 PM, Joel A Divekar

<[email protected]> wrote:

>

> Hi All

> I am trying to do the following

> Search for all lines starting with INSERT command and 
append ; at End of Line

>

> I am aware about search and replace using

> :%s/^INSERT/$;/g

> but this replaces INSERT and not append ; at end of the 
line. Kindly help

> Regards

>



Try,

:%s/^INSERT\(.*\)$/\0\&nbsp\;/g



ie. Capture everything after the INSERT and replace it by itself (\0)

and the text you want you append.

>

> Joel Divekar

> --

> http://mm.ilug-bom.org.in/mailman/listinfo/linuxers



Thanks.

Pratik

-- 

http://mm.ilug-bom.org.in/mailman/listinfo/linuxers

-- 
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers

Reply via email to