From gannam@india.dharma.com Fri Nov 24 02:36:19 2000 Path: uni-berlin.de!fu-berlin.de!newsfeed.mathworks.com!newsxfer.eecs.umich.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: anna3103 Newsgroups: comp.unix.shell Subject: Re: Add a newline with sed Date: Wed, 22 Nov 2000 09:43:06 GMT Organization: Deja.com - Before you buy. Lines: 17 Message-ID: <8vg4fa$9s5$1@nnrp1.deja.com> References: <8vfs3i$38g$1@nnrp1.deja.com> NNTP-Posting-Host: 164.164.87.180 X-Article-Creation-Date: Wed Nov 22 09:43:06 2000 GMT X-Http-User-Agent: Lynx/2.8.1rel.2 libwww-FM/2.14 X-Http-Proxy: 1.0 x69.deja.com:80 (Squid/1.1.22) for client 164.164.87.180 X-MyDeja-Info: XMYDJUIDanna3103 Xref: uni-berlin.de comp.unix.shell:107532 In article <8vfs3i$38g$1@nnrp1.deja.com>, jlguirao@my-deja.com wrote: > Hello, > > I want to find a string in a file and add a newline using sed. It is > possible or is it better to use awk? > > Thanks sed 's/string/str\^Jing/' testfile ^J is got by typing Ctrl-v Ctrl-j is sequence. And ^J is to be escaped with a backslash (\). Sent via Deja.com http://www.deja.com/ Before you buy.