<?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: replacetext processor: replacing '$$$$' with '\$' while replacing content in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/replacetext-processor-replacing-with-while-replacing-content/m-p/203962#M73848</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14000/anilcseiitm2006.html" nodeid="14000" target="_blank"&gt;@Anil Reddy&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;if you are using&lt;/P&gt;&lt;P&gt;Replacement Strategy&lt;/P&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;&lt;P&gt;In &lt;STRONG&gt;ReplaceText processor,&lt;/STRONG&gt; it will add \ before $ sign because $ is special character(end of line) character in Regular expression.&lt;/P&gt;&lt;P&gt;If you use  &lt;/P&gt;&lt;P&gt;Replacement Strategy&lt;/P&gt;&lt;PRE&gt;Always Replace&lt;/PRE&gt;&lt;P&gt;this Strategy &lt;STRONG&gt;won't add&lt;/STRONG&gt; any&lt;STRONG&gt; \&lt;/STRONG&gt; to before&lt;STRONG&gt; $ sign&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I'm not sure if you are going to achieve your desired result with Always Replace strategy.&lt;/P&gt;&lt;P&gt;What you can do to overcome&lt;STRONG&gt; \ issue&lt;/STRONG&gt; is after your first Replace Text Processor(that adds \ before $) &lt;STRONG&gt;add another Replace text processor with below configs.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Search Value&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;\ //search for \(backslash) literal&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Replacement Value&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;${literal('')}  //replace \ with empty&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;Instead of keeping above value(${literal('')}) you can &lt;STRONG&gt;click on check box&lt;/STRONG&gt; that is shown below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56454-setemptystring.png" style="width: 662px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17238i016EC5003048F1AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56454-setemptystring.png" alt="56454-setemptystring.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Both methods above will result same empty string as &lt;STRONG&gt;Replacement Value&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Maximum Buffer Size&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB &lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Replacement Strategy&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Evaluation Mode&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56453-replace.png" style="width: 576px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17239i53B4D34E256C32FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56453-replace.png" alt="56453-replace.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;\$\$\$\$\$\$\$\$hi\$\$\$\$\$\$\$\$&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Output:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;$$$$$$$$hi$$$$$$$$&lt;/PRE&gt;&lt;P&gt;By using two Replace Text processors in series we are going to replace&lt;STRONG&gt; \&lt;/STRONG&gt; that is added in first replace text processor.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 05:07:21 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T05:07:21Z</dc:date>
    <item>
      <title>replacetext processor: replacing '$$$$' with '\$' while replacing content</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/replacetext-processor-replacing-with-while-replacing-content/m-p/203961#M73847</link>
      <description>&lt;P&gt;I am trying to replace the content in the flowfile using replaceText processor.&lt;/P&gt;&lt;P&gt;If the attribute is "myattr" and I replace the content of the flowfile using replaceText processor with ${myattr}. I am seeing the below results&lt;/P&gt;&lt;P&gt;if myattr is "$$this is test$$", then the content of flowfile is replaced as "\$this is test\$"&lt;/P&gt;&lt;P&gt;if myttr is "\$$$this is test$$", then the content of flowfile is replaced as "\$\$this is test\$"&lt;/P&gt;&lt;P&gt;May I know how can I overcome the issue of '\'&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 02:35:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/replacetext-processor-replacing-with-while-replacing-content/m-p/203961#M73847</guid>
      <dc:creator>anilcseiitm2006</dc:creator>
      <dc:date>2018-01-25T02:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: replacetext processor: replacing '$$$$' with '\$' while replacing content</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/replacetext-processor-replacing-with-while-replacing-content/m-p/203962#M73848</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14000/anilcseiitm2006.html" nodeid="14000" target="_blank"&gt;@Anil Reddy&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;if you are using&lt;/P&gt;&lt;P&gt;Replacement Strategy&lt;/P&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;&lt;P&gt;In &lt;STRONG&gt;ReplaceText processor,&lt;/STRONG&gt; it will add \ before $ sign because $ is special character(end of line) character in Regular expression.&lt;/P&gt;&lt;P&gt;If you use  &lt;/P&gt;&lt;P&gt;Replacement Strategy&lt;/P&gt;&lt;PRE&gt;Always Replace&lt;/PRE&gt;&lt;P&gt;this Strategy &lt;STRONG&gt;won't add&lt;/STRONG&gt; any&lt;STRONG&gt; \&lt;/STRONG&gt; to before&lt;STRONG&gt; $ sign&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I'm not sure if you are going to achieve your desired result with Always Replace strategy.&lt;/P&gt;&lt;P&gt;What you can do to overcome&lt;STRONG&gt; \ issue&lt;/STRONG&gt; is after your first Replace Text Processor(that adds \ before $) &lt;STRONG&gt;add another Replace text processor with below configs.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Search Value&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;\ //search for \(backslash) literal&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Replacement Value&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;${literal('')}  //replace \ with empty&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;Instead of keeping above value(${literal('')}) you can &lt;STRONG&gt;click on check box&lt;/STRONG&gt; that is shown below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56454-setemptystring.png" style="width: 662px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17238i016EC5003048F1AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56454-setemptystring.png" alt="56454-setemptystring.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Both methods above will result same empty string as &lt;STRONG&gt;Replacement Value&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Maximum Buffer Size&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;1 MB &lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Replacement Strategy&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Regex Replace&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Evaluation Mode&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="56453-replace.png" style="width: 576px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17239i53B4D34E256C32FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="56453-replace.png" alt="56453-replace.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;\$\$\$\$\$\$\$\$hi\$\$\$\$\$\$\$\$&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Output:-&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;$$$$$$$$hi$$$$$$$$&lt;/PRE&gt;&lt;P&gt;By using two Replace Text processors in series we are going to replace&lt;STRONG&gt; \&lt;/STRONG&gt; that is added in first replace text processor.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:07:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/replacetext-processor-replacing-with-while-replacing-content/m-p/203962#M73848</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T05:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: replacetext processor: replacing '$$$$' with '\$' while replacing content</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/replacetext-processor-replacing-with-while-replacing-content/m-p/203963#M73849</link>
      <description>&lt;P&gt;It works, Thanks alot &lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 17:10:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/replacetext-processor-replacing-with-while-replacing-content/m-p/203963#M73849</guid>
      <dc:creator>anilcseiitm2006</dc:creator>
      <dc:date>2018-01-25T17:10:31Z</dc:date>
    </item>
  </channel>
</rss>

