In vi (or vim anyways) you need to use ctrl-v + enter to indicate a new line
in the replacement string.
eg
:line1/line1<ctrl-v><enter>line1.5/
Ken
#-----Original Message-----
#From: Michael McCabe [mailto:mick at clubi.ie]
#Sent: Thursday, June 29, 2000 11:41
#To: ilug
#Subject: [ILUG] search and replace problem
#
#
#I don't want to start a vi vs. emacs debate. Using vi is it
#possible to
#search for one line and replace it with two lines.
#
#e.g
#
#replace
#
#text of line 1
#
#with
#
#text of line1
#text of line2
#
#I have tried various incarnations of :%s/text of line 1/text of line
#1\ntext of line 2/g
#
#but to no avail.
#
#Cheers,
#M.
#
#
#--
#Irish Linux Users' Group: ilug at linux.ie
#http://www.linux.ie/mailman/listinfo/ilug for (un)subscription
#information.
#List maintainer: listmaster at linux.ie
#
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!