<?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: Concatenating lines in ldapsearch results</title>
	<atom:link href="http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/</link>
	<description></description>
	<lastBuildDate>Fri, 28 Oct 2011 11:10:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: David Fernandez &#187; LDAPSearchWrapLines</title>
		<link>http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/comment-page-1/#comment-2991</link>
		<dc:creator>David Fernandez &#187; LDAPSearchWrapLines</dc:creator>
		<pubDate>Fri, 28 Oct 2011 11:10:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/?p=236#comment-2991</guid>
		<description>[...] Este script se ha obtenido de la dirección: http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Este script se ha obtenido de la dirección: <a href="http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/" rel="nofollow">http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asier Larrabide</title>
		<link>http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/comment-page-1/#comment-2951</link>
		<dc:creator>Asier Larrabide</dc:creator>
		<pubDate>Mon, 04 Oct 2010 08:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/?p=236#comment-2951</guid>
		<description>Many thanks for this post. There&#039;s a little problem with this solution. If the ldif is very big the array could collapse the memory. In my case the ldif allocates 70 gb os disk space, so the script with the array crash.

In this case I would prefer this script:

#!/usr/bin/perl

while ($line = &lt;&gt;) {
        chomp($line);
        if ( $line =~ /^authpassword/ ) {
                next;
        } elsif ( $line =~ /^S+/) { ### this line is a &quot;normal&quot; or starting line
                print &quot;$complete_linen&quot;;
                $complete_line=$line;
        } elsif ( $line =~ /^$/ ) { ### this line is blank
                print &quot;$complete_linen&quot;;
                $complete_line=&quot;&quot;;
        } elsif ( $line =~ /^s+(S.*)/ ) { ### this line is a continuation
                $line =~ s/^s+//;
                $complete_line=$complete_line . $line;
        }
}

This script can be run in a pipe, like this:

# gzcat backup_ldif.gz &#124; ./concat_ldif.pl 


</description>
		<content:encoded><![CDATA[<p>Many thanks for this post. There&#8217;s a little problem with this solution. If the ldif is very big the array could collapse the memory. In my case the ldif allocates 70 gb os disk space, so the script with the array crash.</p>
<p>In this case I would prefer this script:</p>
<p>#!/usr/bin/perl</p>
<p>while ($line = <>) {<br />
        chomp($line);<br />
        if ( $line =~ /^authpassword/ ) {<br />
                next;<br />
        } elsif ( $line =~ /^S+/) { ### this line is a &#8220;normal&#8221; or starting line<br />
                print &#8220;$complete_linen&#8221;;<br />
                $complete_line=$line;<br />
        } elsif ( $line =~ /^$/ ) { ### this line is blank<br />
                print &#8220;$complete_linen&#8221;;<br />
                $complete_line=&#8221;";<br />
        } elsif ( $line =~ /^s+(S.*)/ ) { ### this line is a continuation<br />
                $line =~ s/^s+//;<br />
                $complete_line=$complete_line . $line;<br />
        }<br />
}</p>
<p>This script can be run in a pipe, like this:</p>
<p># gzcat backup_ldif.gz | ./concat_ldif.pl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbutler</title>
		<link>http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/comment-page-1/#comment-2897</link>
		<dc:creator>sbutler</dc:creator>
		<pubDate>Wed, 29 Jul 2009 03:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/?p=236#comment-2897</guid>
		<description>I was having a problem with this script. It doesn&#039;t handle the situation where the continuation line contains spaces. Here&#039;s a better version:&lt;br&gt;&lt;br&gt;$cnt=0;&lt;br&gt;while ($line = &lt;&gt;) {&lt;br&gt;  chomp($line);&lt;br&gt;  if ( $line =~ /^authpassword/ ) {&lt;br&gt;    next;&lt;br&gt;  } elsif ( $line =~ /^S+/) { ### this line is a &quot;normal&quot; or starting line&lt;br&gt;    $results[$cnt++] = $line;&lt;br&gt;  } elsif ( $line =~ /^$/ ) {  ### this line is blank&lt;br&gt;    $results[$cnt++] = &quot;&quot;;&lt;br&gt;  } elsif ( $line =~ /^s+(S.*)/ ) {  ### this line is a continuation&lt;br&gt;    $results[$cnt-1] = $results[$cnt-1] . $1;&lt;br&gt;  }&lt;br&gt;}&lt;br&gt;&lt;br&gt;for $i (0 .. $cnt) {&lt;br&gt;  print &quot;$results[$i]n&quot;;&lt;br&gt;}</description>
		<content:encoded><![CDATA[<p>I was having a problem with this script. It doesn&#39;t handle the situation where the continuation line contains spaces. Here&#39;s a better version:</p>
<p>$cnt=0;<br />while ($line = &lt;&gt;) {<br />  chomp($line);<br />  if ( $line =~ /^authpassword/ ) {<br />    next;<br />  } elsif ( $line =~ /^S+/) { ### this line is a &#8220;normal&#8221; or starting line<br />    $results[$cnt++] = $line;<br />  } elsif ( $line =~ /^$/ ) {  ### this line is blank<br />    $results[$cnt++] = &#8220;&#8221;;<br />  } elsif ( $line =~ /^s+(S.*)/ ) {  ### this line is a continuation<br />    $results[$cnt-1] = $results[$cnt-1] . $1;<br />  }<br />}</p>
<p>for $i (0 .. $cnt) {<br />  print &#8220;$results[$i]n&#8221;;<br />}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbutler</title>
		<link>http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/comment-page-1/#comment-2829</link>
		<dc:creator>sbutler</dc:creator>
		<pubDate>Tue, 28 Jul 2009 20:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/?p=236#comment-2829</guid>
		<description>I was having a problem with this script. It doesn&#039;t handle the situation where the continuation line contains spaces. Here&#039;s a better version:&lt;br&gt;&lt;br&gt;$cnt=0;&lt;br&gt;while ($line = &lt;&gt;) {&lt;br&gt;  chomp($line);&lt;br&gt;  if ( $line =~ /^authpassword/ ) {&lt;br&gt;    next;&lt;br&gt;  } elsif ( $line =~ /^S+/) { ### this line is a &quot;normal&quot; or starting line&lt;br&gt;    $results[$cnt++] = $line;&lt;br&gt;  } elsif ( $line =~ /^$/ ) {  ### this line is blank&lt;br&gt;    $results[$cnt++] = &quot;&quot;;&lt;br&gt;  } elsif ( $line =~ /^s+(S.*)/ ) {  ### this line is a continuation&lt;br&gt;    $results[$cnt-1] = $results[$cnt-1] . $1;&lt;br&gt;  }&lt;br&gt;}&lt;br&gt;&lt;br&gt;for $i (0 .. $cnt) {&lt;br&gt;  print &quot;$results[$i]n&quot;;&lt;br&gt;}</description>
		<content:encoded><![CDATA[<p>I was having a problem with this script. It doesn&#39;t handle the situation where the continuation line contains spaces. Here&#39;s a better version:</p>
<p>$cnt=0;<br />while ($line = &lt;&gt;) {<br />  chomp($line);<br />  if ( $line =~ /^authpassword/ ) {<br />    next;<br />  } elsif ( $line =~ /^S+/) { ### this line is a &#8220;normal&#8221; or starting line<br />    $results[$cnt++] = $line;<br />  } elsif ( $line =~ /^$/ ) {  ### this line is blank<br />    $results[$cnt++] = &#8220;&#8221;;<br />  } elsif ( $line =~ /^s+(S.*)/ ) {  ### this line is a continuation<br />    $results[$cnt-1] = $results[$cnt-1] . $1;<br />  }<br />}</p>
<p>for $i (0 .. $cnt) {<br />  print &#8220;$results[$i]n&#8221;;<br />}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Norris</title>
		<link>http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/comment-page-1/#comment-2757</link>
		<dc:creator>Dan Norris</dc:creator>
		<pubDate>Wed, 15 Apr 2009 22:07:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/?p=236#comment-2757</guid>
		<description>Glad it was helpful. Thanks for stopping by!&lt;br&gt;&lt;br&gt;Please excuse my typos, I sent this from my iPhone.</description>
		<content:encoded><![CDATA[<p>Glad it was helpful. Thanks for stopping by!</p>
<p>Please excuse my typos, I sent this from my iPhone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. Ayme</title>
		<link>http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/comment-page-1/#comment-2756</link>
		<dc:creator>J. Ayme</dc:creator>
		<pubDate>Wed, 15 Apr 2009 14:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/?p=236#comment-2756</guid>
		<description>So usefull !!!&lt;br&gt;&lt;br&gt;I got this issue with dipassistant boostrap (line breaks) and incorrect changetype attribute &lt;br&gt;&lt;br&gt;Thanks Dan !</description>
		<content:encoded><![CDATA[<p>So usefull !!!</p>
<p>I got this issue with dipassistant boostrap (line breaks) and incorrect changetype attribute </p>
<p>Thanks Dan !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Norris</title>
		<link>http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/comment-page-1/#comment-2313</link>
		<dc:creator>Dan Norris</dc:creator>
		<pubDate>Mon, 13 Oct 2008 10:54:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/?p=236#comment-2313</guid>
		<description>Thanks! ...and thanks for stopping by!</description>
		<content:encoded><![CDATA[<p>Thanks! &#8230;and thanks for stopping by!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Haslam</title>
		<link>http://www.dannorris.com/2008/09/08/concatenating-lines-in-ldapsearch-results/comment-page-1/#comment-2301</link>
		<dc:creator>Simon Haslam</dc:creator>
		<pubDate>Sun, 12 Oct 2008 13:46:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/?p=236#comment-2301</guid>
		<description>Very handy Dan. It hadn&#039;t actually occurred to me that you could always use Perl from the Oracle home before - I do often find myself having to do some sort of &quot;munging&quot; across multiple lines and Perl is probably the easiest tool for the job.</description>
		<content:encoded><![CDATA[<p>Very handy Dan. It hadn&#39;t actually occurred to me that you could always use Perl from the Oracle home before &#8211; I do often find myself having to do some sort of &#8220;munging&#8221; across multiple lines and Perl is probably the easiest tool for the job.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

