<?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 How to change csv attribute/header name in apache nifi ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-change-csv-attribute-header-name-in-apache-nifi/m-p/207495#M76734</link>
    <description>&lt;P style="margin-left: 20px;"&gt;I am using apache nifi to convert json to csv. I want to change the headers of the generated csv . Is there any specific processor for this. I know how to achieve this using ExecuteScript processor but is there any easy approach.&lt;BR /&gt;Ex. &lt;BR /&gt;"_id", "name","time"  &lt;STRONG&gt;to&lt;/STRONG&gt; "id", "browser_name","duration"&lt;/P&gt;</description>
    <pubDate>Mon, 02 Apr 2018 13:08:35 GMT</pubDate>
    <dc:creator>vivek_b3ds</dc:creator>
    <dc:date>2018-04-02T13:08:35Z</dc:date>
    <item>
      <title>How to change csv attribute/header name in apache nifi ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-change-csv-attribute-header-name-in-apache-nifi/m-p/207495#M76734</link>
      <description>&lt;P style="margin-left: 20px;"&gt;I am using apache nifi to convert json to csv. I want to change the headers of the generated csv . Is there any specific processor for this. I know how to achieve this using ExecuteScript processor but is there any easy approach.&lt;BR /&gt;Ex. &lt;BR /&gt;"_id", "name","time"  &lt;STRONG&gt;to&lt;/STRONG&gt; "id", "browser_name","duration"&lt;/P&gt;</description>
      <pubDate>Mon, 02 Apr 2018 13:08:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-change-csv-attribute-header-name-in-apache-nifi/m-p/207495#M76734</guid>
      <dc:creator>vivek_b3ds</dc:creator>
      <dc:date>2018-04-02T13:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to change csv attribute/header name in apache nifi ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-change-csv-attribute-header-name-in-apache-nifi/m-p/207496#M76735</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/57161/vivekb3ds.html" nodeid="57161" target="_blank"&gt;@Vivek Singh&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;we can add user defined header by using &lt;STRONG&gt;replace text processor &lt;/STRONG&gt;instead of writing any script.&lt;/P&gt;&lt;P&gt;For this case in your &lt;STRONG&gt;csvsetwriter &lt;/STRONG&gt;controller service change the below property to false,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Include Header Line&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;false&lt;/PRE&gt;&lt;P&gt;now we are not going to get the header line included in the output flowfile, then use &lt;STRONG&gt;Replace text &lt;/STRONG&gt;processor to add our own header to the flowfile content.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Replace text 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="64982-replacetext.png" style="width: 1736px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16955iEC7F7EF11D859E1F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64982-replacetext.png" alt="64982-replacetext.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Search Value&lt;/P&gt;&lt;PRE&gt;(?s)(^.*$)&lt;/PRE&gt;&lt;P&gt;Replacement Value&lt;/P&gt;&lt;PRE&gt;"_id", "name","time" to "id", "browser_name","duration"&lt;/PRE&gt;&lt;P&gt;Character Set&lt;/P&gt;&lt;PRE&gt;UTF-8&lt;/PRE&gt;&lt;P&gt;Maximum Buffer Size&lt;/P&gt;&lt;PRE&gt;1 MB //needs to change the value according to the file size that we are getting after convertrecord processor&lt;/PRE&gt;&lt;P&gt;Replacement Strategy&lt;/P&gt;&lt;PRE&gt;Prepend //we are prepend the the content with the above header line&lt;/PRE&gt;&lt;P&gt;Evaluation Mode&lt;/P&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input content:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;sample content from convert record processor is as follows&lt;/P&gt;&lt;PRE&gt;"1","foo","12:00AM" to "123","Mozilla","1hr"&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Output Content:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;we are adding our header to the above flowfile content the &lt;STRONG&gt;output flowfile content&lt;/STRONG&gt; from &lt;STRONG&gt;replacetext processor&lt;/STRONG&gt; would be&lt;/P&gt;&lt;PRE&gt;"_id", "name","time" to "id", "browser_name","duration"
"1","foo","12:00AM" to "123","Mozilla","1hr"&lt;/PRE&gt;&lt;PRE&gt; If the Answer helped to resolve your issue,&lt;STRONG&gt; Click on Accept button below to accept the answer, &lt;/STRONG&gt;That would be great help to Community users to find solution quickly for these kind of issues.&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 04:33:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-change-csv-attribute-header-name-in-apache-nifi/m-p/207496#M76735</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T04:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to change csv attribute/header name in apache nifi ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-change-csv-attribute-header-name-in-apache-nifi/m-p/289224#M76736</link>
      <description>&lt;P&gt;Instead of using the function: prepend (this just shifts your data), how do you do an outright replace for the header row? I tried using Literal search, but I end up having strange characters when the replace occurs&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 21:55:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-change-csv-attribute-header-name-in-apache-nifi/m-p/289224#M76736</guid>
      <dc:creator>CodingAway</dc:creator>
      <dc:date>2020-02-05T21:55:16Z</dc:date>
    </item>
  </channel>
</rss>

