tag:blogger.com,1999:blog-32637828.post8333046435080174536..comments2023-10-31T16:37:25.528+00:00Comments on fahd.blog: Sed: Mutli-Line Replacement Between Two PatternsFahd Shariffhttp://www.blogger.com/profile/00919911016127601294noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-32637828.post-78004934747943590452016-01-12T16:40:19.133+00:002016-01-12T16:40:19.133+00:00Awesome, tyAwesome, tyPruebahttps://www.blogger.com/profile/13596799099716214098noreply@blogger.comtag:blogger.com,1999:blog-32637828.post-88518518146721797122016-01-11T10:21:20.133+00:002016-01-11T10:21:20.133+00:00Really cool, thanks!Really cool, thanks!Klaushttps://www.blogger.com/profile/04336027978565011575noreply@blogger.comtag:blogger.com,1999:blog-32637828.post-8005378600256182412015-11-06T10:01:20.567+00:002015-11-06T10:01:20.567+00:00Excellent work Fahd.
However just a missing piece...Excellent work Fahd.<br /><br />However just a missing piece that I couldn't work with above. How would you remove everything between foo and bar without deleting full lines?<br /><br />So for example if I have a source of this text.<br /><br />line 1<br />line 2 foo line 3<br />line 4<br />line 5 bar line 6<br />line 7<br /><br />And I want to remove everything between foo and bar only where output will look like below.<br />line 1<br />line 2 line 6<br />line 7<br /><br />Many thanks in advance.Kamran Shahhttps://www.blogger.com/profile/00271371129496725815noreply@blogger.comtag:blogger.com,1999:blog-32637828.post-24846487262199292612014-06-22T21:53:39.106+01:002014-06-22T21:53:39.106+01:00Very helpful! Thanks!Very helpful! Thanks!Pradeep Kumarhttps://www.blogger.com/profile/10471228622109658246noreply@blogger.comtag:blogger.com,1999:blog-32637828.post-49575916772459198922014-05-14T22:14:58.249+01:002014-05-14T22:14:58.249+01:00Awesome article, quite helpful.
However I must sa...Awesome article, quite helpful.<br /><br />However I must say that the number 6 needs a bit of tweaking. If you run the command with sed -n the output is fine. But if you use sed -n -i, it double each line in the file.<br /><br />To get it work, I had to remove the first "p" after the bracket and also add my first pattern in the replacement (dunno why the second one was not affected)<br /><br />Excuse for my bad english, I am french from Québec, Canada<br /><br />LarowAnonymoushttps://www.blogger.com/profile/03773482043925930143noreply@blogger.comtag:blogger.com,1999:blog-32637828.post-77479942870579877722014-02-14T19:24:34.325+00:002014-02-14T19:24:34.325+00:00Thanks for taking the time to put this post togeth...Thanks for taking the time to put this post together, it was very helpful!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-32637828.post-16234372936433701972014-02-10T10:36:37.036+00:002014-02-10T10:36:37.036+00:00Nice article. In #5, how can I replace contents fr...Nice article. In #5, how can I replace contents from another file? i.e. REPLACEMENT is contents of another fileVishnu Agrawalhttps://www.blogger.com/profile/16272701058668436071noreply@blogger.comtag:blogger.com,1999:blog-32637828.post-77982915854864821652014-02-03T20:37:09.060+00:002014-02-03T20:37:09.060+00:00very useful, thank you!!very useful, thank you!!Anonymoushttps://www.blogger.com/profile/15117011705685668246noreply@blogger.comtag:blogger.com,1999:blog-32637828.post-40089633063487788202013-04-10T07:49:24.802+01:002013-04-10T07:49:24.802+01:00Awesome post..
Really helpful...
Awesome post..<br />Really helpful...<br />suchetahttps://www.blogger.com/profile/09524692516974950178noreply@blogger.com