<?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: nifi-replace file headers using replacetext processor in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/nifi-replace-file-headers-using-replacetext-processor/m-p/354871#M237002</link>
    <description>&lt;P&gt;thanks ,Green!&lt;/P&gt;&lt;P&gt;your idea helped me solve the problem&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 09:07:29 GMT</pubDate>
    <dc:creator>kami</dc:creator>
    <dc:date>2022-10-14T09:07:29Z</dc:date>
    <item>
      <title>nifi-replace file headers using replacetext processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/nifi-replace-file-headers-using-replacetext-processor/m-p/354599#M236943</link>
      <description>&lt;P&gt;i got a bunch of files with differert headers&amp;nbsp;&lt;/P&gt;&lt;P&gt;for files of one type,their may be two kinds of headers,i.e. the following &lt;STRONG&gt;two&amp;nbsp;type(call it type1 and type 2)&lt;/STRONG&gt; of files's headers&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;type1: &lt;/STRONG&gt;a,b,&lt;STRONG&gt;c34&lt;/STRONG&gt;,d&amp;nbsp; &amp;nbsp; &amp;nbsp;or&amp;nbsp; &amp;nbsp; &amp;nbsp;a,b,&lt;STRONG&gt;c&lt;/STRONG&gt;,d&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;type2: &lt;/STRONG&gt;d,e,f,&lt;STRONG&gt;kgg&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/STRONG&gt;or&amp;nbsp; &amp;nbsp; &amp;nbsp;d,e,f,&lt;STRONG&gt;g&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;notice that the third field names of &lt;STRONG&gt;type1&lt;/STRONG&gt; are&lt;STRONG&gt; c &lt;/STRONG&gt;or&lt;STRONG&gt;&amp;nbsp;c34,&lt;/STRONG&gt;the forth field names of &lt;STRONG&gt;type2&amp;nbsp;&lt;/STRONG&gt;are&amp;nbsp;&lt;STRONG&gt;kgg &lt;/STRONG&gt;or&lt;STRONG&gt;&amp;nbsp;g,&lt;/STRONG&gt;the field name &lt;STRONG&gt;c34&lt;/STRONG&gt; and &lt;STRONG&gt;kgg&lt;/STRONG&gt;&amp;nbsp;are wrong, and need to be changed to&amp;nbsp;&lt;STRONG&gt;c&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;g&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;i want to change the headers only(that is, the first line) using&amp;nbsp; kv pairs, key is the string to be replaced and value is the&amp;nbsp; replacement value ,such as&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"c34":"c"&lt;/P&gt;&lt;P&gt;"kgg":"g"&lt;/P&gt;&lt;P&gt;"hqq":"h"&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;i want to do this using&amp;nbsp; replacetext &lt;STRONG&gt;but the processor replacetext could only set one search and&amp;nbsp; replacement value,that's the problem!!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;any ideas would be welcome&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kami_0-1665557020574.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/35890iFC7294B3F53B1885/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kami_0-1665557020574.png" alt="kami_0-1665557020574.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 06:48:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/nifi-replace-file-headers-using-replacetext-processor/m-p/354599#M236943</guid>
      <dc:creator>kami</dc:creator>
      <dc:date>2022-10-12T06:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: nifi-replace file headers using replacetext processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/nifi-replace-file-headers-using-replacetext-processor/m-p/354614#M236946</link>
      <description>&lt;P&gt;Perhaps JoltTransformRecord could help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The jolt transformation "shift" let's you rename fields - in a csv file's case, headers.&lt;/P&gt;&lt;P&gt;If you know all your replaces ahead of time, you could define a transformation like:&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;operation: shift&lt;/P&gt;&lt;P&gt;spec: {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "kgg":"g",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "c34":"c",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "*":"&amp;amp;"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note the last shift, "*":"&amp;amp;" ,&amp;nbsp; which would transfer over the rest of the headers you didn't specifically rename.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 10:18:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/nifi-replace-file-headers-using-replacetext-processor/m-p/354614#M236946</guid>
      <dc:creator>Green_</dc:creator>
      <dc:date>2022-10-12T10:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: nifi-replace file headers using replacetext processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/nifi-replace-file-headers-using-replacetext-processor/m-p/354746#M236971</link>
      <description>&lt;P&gt;thanks ! that's a good idea&lt;BR /&gt;i'll have a try&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 10:39:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/nifi-replace-file-headers-using-replacetext-processor/m-p/354746#M236971</guid>
      <dc:creator>kami</dc:creator>
      <dc:date>2022-10-13T10:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: nifi-replace file headers using replacetext processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/nifi-replace-file-headers-using-replacetext-processor/m-p/354871#M237002</link>
      <description>&lt;P&gt;thanks ,Green!&lt;/P&gt;&lt;P&gt;your idea helped me solve the problem&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 09:07:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/nifi-replace-file-headers-using-replacetext-processor/m-p/354871#M237002</guid>
      <dc:creator>kami</dc:creator>
      <dc:date>2022-10-14T09:07:29Z</dc:date>
    </item>
  </channel>
</rss>

