Computing.Net > Forums > Linux > SED - change a word by a new line

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SED - change a word by a new line

Reply to Message Icon

Name: fmr1909
Date: April 4, 2005 at 14:13:46 Pacific
OS: SuSE 9.1
CPU/Ram: p III 900
Comment:

Using sed, can I change a word with a new line, spliting the original line in two?

Example of original line:

This is a line.

I want to take the word "is" and change it by a EOF, and teh result will be:

This
a line.

Thanks

Francisco

help



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: April 5, 2005 at 04:37:01 Pacific
Reply:

Yes you can.

echo "This is a line" | sed -e 's/ is /\
is /'

This
is a line


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: SED - change a word by a new line

go through a file line by line? www.computing.net/answers/linux/go-through-a-file-line-by-line/24907.html

SED to replace Word by Word www.computing.net/answers/linux/sed-to-replace-word-by-word/15865.html

problem with g++ in a new RH9 insta www.computing.net/answers/linux/problem-with-g-in-a-new-rh9-insta/20351.html