I'm working in a unix environment where only VI is available, not VIM.
 I am trying to get a regular expression to basically do a find and
replace in several files that spans several lines. I have googled it
and can't find much.  \n seems to be what I remember, as well as what
I have found in various pages, but it doesn't work.

For example I would like to replace

line1
line2

with

line1
addline3
line2

and I try
:%s/line1\nline2/line1\naddline3\nline2/g
I've even tried just searching for it.
/line1\nline2

nothing seems to work.

Does anyone know how I can do this (don't feel limited to vi, I've
tried ed and sed and can't get the syntax correct on those either)?

Thanks
Chris

-----------------------------------------------------------------
To get off this list, send email to [EMAIL PROTECTED]
with Subject: unsubscribe
-----------------------------------------------------------------

Reply via email to