![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Newlines in shell variables | narcvs | Shell Programming and Scripting | 5 | 03-26-2009 02:54 AM |
| sed problem replacing long strings | mark007 | UNIX for Dummies Questions & Answers | 1 | 11-28-2008 12:02 AM |
| replacing comma's with newlines using sed | newbie_coder | Shell Programming and Scripting | 5 | 09-29-2008 12:44 AM |
| replacing strings with text from other file | mc1392 | Shell Programming and Scripting | 1 | 03-24-2008 03:46 PM |
| Newbie: replacing strings containing special caracters | drumkid | UNIX for Dummies Questions & Answers | 1 | 04-03-2006 03:39 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
replacing strings with newlines : sed
Hi everyone,
Since the previous time I received help from unix.com I have been encouraged to learn more. going through 1 of the articles(View Article) on sed I found, it pointed an interesting situation. Suppose the text is : Romeo and Ethel the Dancer Moves Audience to Tears. I was treated to the off Broadway opening of Romeo and Ethel the Dancer. This moving story of star-crossed lovers had the audience in tears half way through the third act. Do not go to see this play without a hanky, but even the weeping from the back row could not diminish the brilliance of Romeo and Ethel the Dancer by William Shakespeare. Now I want to replace "Romeo and Ethel the Dancer" by "Romeo and Juliet". The lines are separated by newlines. The article demontrates doing this by using addresses. I was trying to think of another way round by building a reg-ex and use simple sed. I believe I need a way to represent a newline in the sed search expression. Please help by hinting towards the solution and not directly. Thank You. Regards Last edited by hkansal; 11-28-2008 at 01:27 PM.. Reason: Added link back to original article |
![]() |
| Bookmarks |
| Tags |
| multiline, sed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|