<?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 Nifi - CSV with duplicate headers in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Nifi-CSV-with-duplicate-headers/m-p/336779#M232382</link>
    <description>&lt;P&gt;Hi I'm using nifi 1.11.4 and I came across the following issue:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm dynamically reading a CSV file that contains 2 headers with the same name ( can't use avro schema registry as I don't the header names in advance). When I'm trying to use CSVReader to read the file "I'm getting duplicate header error". How can I handle this situation?&lt;BR /&gt;&lt;BR /&gt;Note: I need to maintain the same header name.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Feb 2022 16:25:22 GMT</pubDate>
    <dc:creator>celestial1122</dc:creator>
    <dc:date>2022-02-22T16:25:22Z</dc:date>
    <item>
      <title>Nifi - CSV with duplicate headers</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-CSV-with-duplicate-headers/m-p/336779#M232382</link>
      <description>&lt;P&gt;Hi I'm using nifi 1.11.4 and I came across the following issue:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm dynamically reading a CSV file that contains 2 headers with the same name ( can't use avro schema registry as I don't the header names in advance). When I'm trying to use CSVReader to read the file "I'm getting duplicate header error". How can I handle this situation?&lt;BR /&gt;&lt;BR /&gt;Note: I need to maintain the same header name.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 16:25:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-CSV-with-duplicate-headers/m-p/336779#M232382</guid>
      <dc:creator>celestial1122</dc:creator>
      <dc:date>2022-02-22T16:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - CSV with duplicate headers</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-CSV-with-duplicate-headers/m-p/336816#M232395</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/96031"&gt;@celestial1122&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you could provide a sample of the input data you have and the expected output, it would help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in general, once NiFi converts the CSV data into flowfile records, the record cannot have duplicated column names. If you want to keep both columns' values, you must rename one of them to a different name. You could do that, for example, using a ReplaceText processor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you could provide examples, we could probably help with more ideas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;André&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 01:20:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-CSV-with-duplicate-headers/m-p/336816#M232395</guid>
      <dc:creator>araujo</dc:creator>
      <dc:date>2022-02-23T01:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Nifi - CSV with duplicate headers</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Nifi-CSV-with-duplicate-headers/m-p/336820#M232396</link>
      <description>&lt;P&gt;Actually, an easier way to ignore the column name duplication and still process the columns correctly, would be to use a schema to describe your data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, say you have the following CSV:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;col_a,col_b,col_b
1,2,3
4,5,6&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can configure your CSVReader with the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="araujo_0-1645579635567.png" style="width: 659px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/33658iD8CADFD2DF202E82/image-dimensions/659x211?v=v2" width="659" height="211" role="button" title="araujo_0-1645579635567.png" alt="araujo_0-1645579635567.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="araujo_1-1645579682280.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/33659i32B2357B8B9E18DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="araujo_1-1645579682280.png" alt="araujo_1-1645579682280.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the data will be processed correctly:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="araujo_2-1645579732546.png" style="width: 181px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/33660i3C00D2C4AB51384B/image-dimensions/181x122?v=v2" width="181" height="122" role="button" title="araujo_2-1645579732546.png" alt="araujo_2-1645579732546.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;André&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 01:29:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Nifi-CSV-with-duplicate-headers/m-p/336820#M232396</guid>
      <dc:creator>araujo</dc:creator>
      <dc:date>2022-02-23T01:29:29Z</dc:date>
    </item>
  </channel>
</rss>

