<?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: How can I change specific column title in CSV file using NiFi? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214801#M176713</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; &lt;/P&gt;&lt;P&gt;Though it did not work with this one and flow file going to failure relationship without modification. It's alright as I get it worked with Convert Record. Thanks for help.&lt;/P&gt;&lt;P&gt;May I know Is there any way to avoid change of header in CSV and We can map CSV header to database table column directly similar to any ETL tool?&lt;/P&gt;</description>
    <pubDate>Fri, 26 Oct 2018 00:53:02 GMT</pubDate>
    <dc:creator>dobariyas</dc:creator>
    <dc:date>2018-10-26T00:53:02Z</dc:date>
    <item>
      <title>How can I change specific column title in CSV file using NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214797#M176709</link>
      <description>&lt;P&gt;This is my dataflow - &lt;/P&gt;&lt;P&gt;Getfile (CSV) -&amp;gt; PutSQL (To truncate the database table in MS SQL) -&amp;gt; PutDatabaseRecord (To Insert record in the table) -&amp;gt; LogAttributes upon success or failure &lt;/P&gt;&lt;P&gt;I have following header row in CSV file. &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;
  &lt;TD&gt;Date&lt;/TD&gt;
  &lt;TD&gt;Location&lt;/TD&gt;
  &lt;TD&gt;Name&lt;/TD&gt;
  &lt;TD&gt;Manager&lt;/TD&gt;
  &lt;TD&gt;Division&lt;/TD&gt;
  &lt;TD&gt;Revenue&lt;/TD&gt;
  &lt;TD&gt;PV&lt;/TD&gt;
  &lt;TD&gt;&lt;STRONG&gt;NMS OnLine&lt;/STRONG&gt;&lt;/TD&gt;
  &lt;TD&gt;&lt;STRONG&gt;NMS LHSC&lt;/STRONG&gt;&lt;/TD&gt;
  &lt;TD&gt;&lt;STRONG&gt;RMS OnLine&lt;/STRONG&gt;&lt;/TD&gt;
  &lt;TD&gt;&lt;STRONG&gt;RMS LHSC&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I want to change the name of the last four column &lt;/P&gt;&lt;P&gt;From &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;
  &lt;TD&gt;NMS OnLine&lt;/TD&gt;
  &lt;TD&gt;NMS LHSC&lt;/TD&gt;
  &lt;TD&gt;RMS OnLine&lt;/TD&gt;
  &lt;TD&gt;RMS LHSC &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; To &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;
  &lt;TD&gt;NMSOnLine&lt;/TD&gt;
  &lt;TD&gt;NMSLHSC&lt;/TD&gt;
  &lt;TD&gt;RMSOnLine&lt;/TD&gt;
  &lt;TD&gt;RMSLHSC&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;as Original name  is not matching to table column name in database.&lt;/P&gt;&lt;P&gt;I am trying to use ReplaceTextProcessor but it is not working.&lt;/P&gt;&lt;P&gt;How do I achieve this?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/12415"&gt;@Shu&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:49:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214797#M176709</guid>
      <dc:creator>dobariyas</dc:creator>
      <dc:date>2022-09-16T13:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change specific column title in CSV file using NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214798#M176710</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/97607/dobariyas.html" nodeid="97607"&gt;@Sandip Dobariya&lt;/A&gt;&lt;P&gt;If your csv file size is not huge then you can use on of the mentioned way in &lt;A href="https://stackoverflow.com/questions/52428510/is-it-possible-to-remove-white-spaces-from-the-csv-files-header-name-in-nifi/52432241#52432241" target="_blank"&gt;this&lt;/A&gt; link.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(or)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;By using record oriented processor(ConvertRecord..etc) which more efficient way of doing this task. &lt;/P&gt;&lt;P&gt;Configure the &lt;STRONG&gt;ConvertRecord&lt;/STRONG&gt; processor with &lt;STRONG&gt;CsvReader&lt;/STRONG&gt; and &lt;STRONG&gt;CsvWriter&lt;/STRONG&gt; controller service(&lt;STRONG&gt;include header line 'False'&lt;/STRONG&gt;). then use &lt;STRONG&gt;ReplaceText&lt;/STRONG&gt; processor to prepend the header line to the csv file.&lt;/P&gt;&lt;P&gt;Refer to &lt;A href="https://community.hortonworks.com/questions/183313/how-to-change-csv-attributeheader-name-in-apache-n.html" target="_blank"&gt;this&lt;/A&gt; link for more reference.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 06:22:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214798#M176710</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-10-24T06:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change specific column title in CSV file using NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214799#M176711</link>
      <description>&lt;P&gt;Hi Shu,&lt;/P&gt;&lt;P&gt;Let me thank you for your quick response and it is really helpful.&lt;/P&gt;&lt;P&gt;I have tried both way and it worked using&lt;STRONG&gt; ConvertRecord&lt;/STRONG&gt; and &lt;STRONG&gt;ReplaceText.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;May I know the reason why it is not working using just ReplaceText with huge file? My CSV file contains &amp;gt;60K reocrds. &lt;/P&gt;&lt;P&gt;I was using below &lt;STRONG&gt;ReplaceText&lt;/STRONG&gt; configs as you advised  but it is getting failed.&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;Search Value&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;(.*)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Replacement Value&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;${'$1':replace(" ","")}&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 Oct 2018 12:00:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214799#M176711</guid>
      <dc:creator>dobariyas</dc:creator>
      <dc:date>2018-10-24T12:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change specific column title in CSV file using NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214800#M176712</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/97607/dobariyas.html" nodeid="97607"&gt;@Sandip Dobariya&lt;/A&gt;&lt;P&gt;Try with this configurations in &lt;STRONG&gt;ReplaceText &lt;/STRONG&gt;processor and this configs, we are only applying&lt;STRONG&gt; nifi expression language replace&lt;/STRONG&gt; function on &lt;STRONG&gt;first line of the extracted content &lt;/STRONG&gt;not on all lines and this expression replaces &lt;STRONG&gt;spaces in first line&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;Search Value: &lt;/P&gt;&lt;PRE&gt; (?s)(^[^\n]*)(.*$) &lt;/PRE&gt;&lt;P&gt;Replacement Value: &lt;/P&gt;&lt;PRE&gt; ${'$1':replace(" ","")}$2 &lt;/PRE&gt;&lt;P&gt;Replacement Strategy &lt;/P&gt;&lt;PRE&gt;RegexReplace &lt;/PRE&gt;&lt;P&gt;Evaluation Mode &lt;/P&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;P style="margin-left: 20px;"&gt;&lt;STRONG&gt;Input:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Date,Location,Name,Manager,Division,Revenue,PVNMS OnLine,NMS LHSC,RMS OnLineRMS LHSC&lt;BR /&gt;&lt;/PRE&gt;&lt;P style="margin-left: 20px;"&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Date,Location,Name,Manager,Division,Revenue,PVNMSOnLine,NMSLHSC,RMSOnLineRMSLHSC&lt;BR /&gt;&lt;/PRE&gt;&lt;P style="margin-left: 20px;"&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 19:57:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214800#M176712</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-10-24T19:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change specific column title in CSV file using NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214801#M176713</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; &lt;/P&gt;&lt;P&gt;Though it did not work with this one and flow file going to failure relationship without modification. It's alright as I get it worked with Convert Record. Thanks for help.&lt;/P&gt;&lt;P&gt;May I know Is there any way to avoid change of header in CSV and We can map CSV header to database table column directly similar to any ETL tool?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 00:53:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/214801#M176713</guid>
      <dc:creator>dobariyas</dc:creator>
      <dc:date>2018-10-26T00:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change specific column title in CSV file using NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/329261#M230416</link>
      <description>&lt;P&gt;if I want to replace more then one How?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example I tried this&amp;nbsp;&lt;/P&gt;&lt;P&gt;${'$1':replace("ClientName","Client Name"),'$2':replace("Ageinyears ","Age in years")}&lt;/P&gt;&lt;P&gt;but not work&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 12:15:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-change-specific-column-title-in-CSV-file-using/m-p/329261#M230416</guid>
      <dc:creator>Saraali</dc:creator>
      <dc:date>2021-10-30T12:15:14Z</dc:date>
    </item>
  </channel>
</rss>

