<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Replacing new lines, weird behavior observed in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192980#M71104</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; thanks for the response will try and get back to you, appreciate it&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2017 03:20:00 GMT</pubDate>
    <dc:creator>dhieru</dc:creator>
    <dc:date>2017-11-10T03:20:00Z</dc:date>
    <item>
      <title>Replacing new lines, weird behavior observed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192976#M71100</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="43536-line1.png" style="width: 405px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18232iC947B5F462B75A7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43536-line1.png" alt="43536-line1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="43537-lne2.png" style="width: 529px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18233i15EF3574EF7A1E5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43537-lne2.png" alt="43537-lne2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Thanks a lot to this awesome community. &lt;/P&gt;&lt;P&gt;I am observing a new line is added in the beginning after replacing a text. but when observed through nifi ui I do not see the new line in the beginning.&lt;/P&gt;&lt;P&gt;I reffered this link&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/147226/replacetextprocessor-remove-blank-lines.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.hortonworks.com/questions/147226/replacetextprocessor-remove-blank-lines.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Any suggestion&lt;/P&gt;&lt;P&gt;Thanks Dheeru&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:04:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192976#M71100</guid>
      <dc:creator>dhieru</dc:creator>
      <dc:date>2019-08-18T07:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing new lines, weird behavior observed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192977#M71101</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/20255/dheeruksingh.html" nodeid="20255"&gt;@dhieru singh&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can you once check your replace text processor configurations&lt;/P&gt;&lt;P&gt;if the &lt;STRONG&gt;Replacement Strategy property as Prepend&lt;/STRONG&gt; that means you are adding new line at starting of the file.&lt;/P&gt;&lt;P&gt;As that new line won't show in &lt;STRONG&gt;NiFi UI&lt;/STRONG&gt; but when you do &lt;STRONG&gt;cat on the file&lt;/STRONG&gt; then only it shows the new line.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/7057iB777971DB3BE51EF/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="op.png" title="op.png" /&gt;</description>
      <pubDate>Fri, 10 Nov 2017 01:23:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192977#M71101</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2017-11-10T01:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing new lines, weird behavior observed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192978#M71102</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929" target="_blank"&gt;@Shu&lt;/A&gt; Thanks for the response I appreciate it. No I am not using &lt;STRONG&gt;Prepend strategy &lt;/STRONG&gt;I am using &lt;STRONG&gt;regex replace all &lt;/STRONG&gt;attached is the image&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="43540-regexreplace.png" style="width: 776px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18231i3877A16FD113899B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43540-regexreplace.png" alt="43540-regexreplace.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:03:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192978#M71102</guid>
      <dc:creator>dhieru</dc:creator>
      <dc:date>2019-08-18T07:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing new lines, weird behavior observed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192979#M71103</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/20255/dheeruksingh.html" nodeid="20255" target="_blank"&gt;@dhieru singh&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;If your file having any &lt;STRONG&gt;new line &lt;/STRONG&gt;as first line of your file that would &lt;STRONG&gt;won't show&lt;/STRONG&gt; in &lt;STRONG&gt;NiFi UI.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;you need to use &lt;STRONG&gt;another replace text processor&lt;/STRONG&gt; following with the existing &lt;STRONG&gt;replace text processor&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;Search value&lt;/STRONG&gt; property as &lt;/P&gt;&lt;PRE&gt;(\s$|^\s*)(.*) //match if you are having any new lines in starting and ending position of the file&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Replacement value&lt;/STRONG&gt; property as &lt;STRONG&gt;$2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42530-regex.png" style="width: 1512px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18230i0BFACD1EBB68D063/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42530-regex.png" alt="42530-regex.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Why existing replace text won't match empty lines?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As you are having replace text processor with&lt;/P&gt;&lt;PRE&gt;\n+\s //matches for only empty lines in between the text but not first&lt;/PRE&gt;&lt;P&gt;If you have empty lines in between the text then you are going to replace them with shift+enter.&lt;/P&gt;&lt;P&gt;But in&lt;STRONG&gt; this case&lt;/STRONG&gt; you are having&lt;STRONG&gt; empty line at starting&lt;/STRONG&gt; of the &lt;STRONG&gt;file &lt;/STRONG&gt;then you need to take off them,that's the reason why you need to use &lt;STRONG&gt;another replace text processor&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;First replace text processor //is going to replace empty lines in text with shift+enter.&amp;lt;br&amp;gt;second replace text processor //replace empty lines at first and end lines in text then remove them from file&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:03:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192979#M71103</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T07:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing new lines, weird behavior observed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192980#M71104</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; thanks for the response will try and get back to you, appreciate it&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 03:20:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192980#M71104</guid>
      <dc:creator>dhieru</dc:creator>
      <dc:date>2017-11-10T03:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing new lines, weird behavior observed</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192981#M71105</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; I checked again, the regex \n+\s+ does not remove the first line if it is blank, other than that it replaces all the blank lines, even if there are empty lines in the end, trying your regex for removing first blank line Thanks again &lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 03:40:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Replacing-new-lines-weird-behavior-observed/m-p/192981#M71105</guid>
      <dc:creator>dhieru</dc:creator>
      <dc:date>2017-11-10T03:40:30Z</dc:date>
    </item>
  </channel>
</rss>

