<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: sed and Multi-Line Search and Replace</title>
	<atom:link href="http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/feed/" rel="self" type="application/rss+xml" />
	<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/</link>
	<description>A blog about philosophy, Christianity, web development and whatever else I feel like writing about.</description>
	<lastBuildDate>Sun, 12 Feb 2012 04:19:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2-RC4-18391</generator>
	<item>
		<title>By: Bash/CLI by dchirila - Pearltrees</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-214533</link>
		<dc:creator>Bash/CLI by dchirila - Pearltrees</dc:creator>
		<pubDate>Fri, 13 Jan 2012 22:13:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-214533</guid>
		<description>[...] sed and Multi-Line Search and Replace – Austin Matzko&#039;s Blog [...]</description>
		<content:encoded><![CDATA[<p>[...] sed and Multi-Line Search and Replace – Austin Matzko&#039;s Blog [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tweak linux by masterofthewind - Pearltrees</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-214532</link>
		<dc:creator>tweak linux by masterofthewind - Pearltrees</dc:creator>
		<pubDate>Fri, 13 Jan 2012 22:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-214532</guid>
		<description>[...] mv -f $ 1 .tmp $outputfile ; sed and Multi-Line Search and Replace – Austin Matzko&#039;s Blog [...]</description>
		<content:encoded><![CDATA[<p>[...] mv -f $ 1 .tmp $outputfile ; sed and Multi-Line Search and Replace – Austin Matzko&#039;s Blog [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to save your Twitter timeline to a file with a simple script &#124; TechRepublic</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-213699</link>
		<dc:creator>How to save your Twitter timeline to a file with a simple script &#124; TechRepublic</dc:creator>
		<pubDate>Tue, 27 Sep 2011 13:00:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-213699</guid>
		<description>[...] upper case in the snippet above. Line 24 of the script, which I gratefully copied and adapted from Austin Matzko&#8217;s blog, is the sed way to find and replace text patterns over two consecutive lines. Running the script [...]</description>
		<content:encoded><![CDATA[<p>[...] upper case in the snippet above. Line 24 of the script, which I gratefully copied and adapted from Austin Matzko&#8217;s blog, is the sed way to find and replace text patterns over two consecutive lines. Running the script [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sed onliner to joing lines broken by a single carriage return &#171; Nachopp&#039;s Blog</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-213698</link>
		<dc:creator>sed onliner to joing lines broken by a single carriage return &#171; Nachopp&#039;s Blog</dc:creator>
		<pubDate>Mon, 26 Sep 2011 15:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-213698</guid>
		<description>[...] sed command tells to put a space and remove the line break. using the multiline search and replace method  The second just gets rid of the leading white space at the beginning of line)    [...]</description>
		<content:encoded><![CDATA[<p>[...] sed command tells to put a space and remove the line break. using the multiline search and replace method  The second just gets rid of the leading white space at the beginning of line)    [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Plank</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-213684</link>
		<dc:creator>Andreas Plank</dc:creator>
		<pubDate>Thu, 22 Sep 2011 17:49:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-213684</guid>
		<description>Your examples will fail, take care of / and \/!
Change
&lt;code&gt;s/&lt;h2.*&lt;/h2&gt;/No title here/g&lt;/code&gt;
to
&lt;code&gt;s/&lt;h2.*&lt;\/h2&gt;/No title here/g&lt;/code&gt;
or
&lt;code&gt;s@&lt;h2.*&lt;/h2&gt;@No title here@g&lt;/code&gt;

Andreas</description>
		<content:encoded><![CDATA[<p>Your examples will fail, take care of / and \/!<br />
Change<br />
<code>s/&lt;h2.*&lt;/h2&gt;/No title here/g</code><br />
to<br />
<code>s/&lt;h2.*&lt;\/h2&gt;/No title here/g</code><br />
or<br />
<code>s@&lt;h2.*&lt;/h2&gt;@No title here@g</code></p>
<p>Andreas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pull desired sequences out of a multiple FASTA file with regex pattern match &#124; the act or process of arranging</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-213665</link>
		<dc:creator>Pull desired sequences out of a multiple FASTA file with regex pattern match &#124; the act or process of arranging</dc:creator>
		<pubDate>Tue, 13 Sep 2011 21:01:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-213665</guid>
		<description>[...] This posting from austin matzko &#8216;s blog looked really useful, but ultimately The Grymoire awed me with its comprehensiveness and clarity, in this case, for all things sed. [...]</description>
		<content:encoded><![CDATA[<p>[...] This posting from austin matzko &#8216;s blog looked really useful, but ultimately The Grymoire awed me with its comprehensiveness and clarity, in this case, for all things sed. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-213536</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Fri, 22 Jul 2011 18:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-213536</guid>
		<description>A variation of your sample I am using:

&lt;code&gt;
sed -n -e &#039;/&lt;filter&gt;/,/&lt;\/filter&gt;/ {
  /&lt;criteriaItems&gt;/,/&lt;\/criteriaItems&gt;/ { 
    /&lt;criteriaItems&gt;/h
    /&lt;criteriaItems&gt;/!H
    /&lt;\/criteriaItems&gt;/ {
       g
       s/ *\n *//g
       p
    }
  }
}
&#039; &quot;$i&quot; &gt; &quot;$i&quot;.crit
&lt;/code&gt;

In this example, I am removing line wraps so I can easily do a grep on the contents between a beginning and ending XML statement.</description>
		<content:encoded><![CDATA[<p>A variation of your sample I am using:</p>
<p><code><br />
sed -n -e '/&lt;filter&gt;/,/&lt;\/filter&gt;/ {<br />
  /&lt;criteriaItems&gt;/,/&lt;\/criteriaItems&gt;/ {<br />
    /&lt;criteriaItems&gt;/h<br />
    /&lt;criteriaItems&gt;/!H<br />
    /&lt;\/criteriaItems&gt;/ {<br />
       g<br />
       s/ *\n *//g<br />
       p<br />
    }<br />
  }<br />
}<br />
' "$i" &gt; "$i".crit<br />
</code></p>
<p>In this example, I am removing line wraps so I can easily do a grep on the contents between a beginning and ending XML statement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-213535</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Fri, 22 Jul 2011 18:45:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-213535</guid>
		<description>Thanks you, your example works as expected.  However, after viewing your code I came-up with a simpler version:

&lt;code&gt;
sed -e &#039;/&lt;h2/,/&lt;\/h2&gt;/{s/&lt;h2.*/No text here/p;d}&#039; sample.php&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Thanks you, your example works as expected.  However, after viewing your code I came-up with a simpler version:</p>
<p><code><br />
sed -e '/&lt;h2/,/&lt;\/h2&gt;/{s/&lt;h2.*/No text here/p;d}' sample.php</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: atomopawn</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-213195</link>
		<dc:creator>atomopawn</dc:creator>
		<pubDate>Thu, 05 May 2011 14:07:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-213195</guid>
		<description>Thanks!  I found this incredibly helpful.  In my case, the second approach works better than the first, though, because sed uses the &quot;longest match&quot; rule.  I needed to replace several multiline sections, not just one.  So the first approach (which replaced ALL sections with the new patter) didn&#039;t work for me.  The second &quot;less efficient&quot; approach did exactly what I wanted.

Thanks again!</description>
		<content:encoded><![CDATA[<p>Thanks!  I found this incredibly helpful.  In my case, the second approach works better than the first, though, because sed uses the &#8220;longest match&#8221; rule.  I needed to replace several multiline sections, not just one.  So the first approach (which replaced ALL sections with the new patter) didn&#8217;t work for me.  The second &#8220;less efficient&#8221; approach did exactly what I wanted.</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Refining Linux</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/comment-page-1/#comment-212904</link>
		<dc:creator>Refining Linux</dc:creator>
		<pubDate>Sun, 19 Dec 2010 23:01:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458#comment-212904</guid>
		<description>&lt;strong&gt;#20: Multi-line sed search and replace...&lt;/strong&gt;

This article is part of the 2010 Advent calendar series “24 Short Linux Hints”. This series focuses on little (and sometimes longer) tricks, tips and hints to solve common problems and really improve your workflow. sed is built to process strings (eith...</description>
		<content:encoded><![CDATA[<p><strong>#20: Multi-line sed search and replace&#8230;</strong></p>
<p>This article is part of the 2010 Advent calendar series “24 Short Linux Hints”. This series focuses on little (and sometimes longer) tricks, tips and hints to solve common problems and really improve your workflow. sed is built to process strings (eith&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

