<?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 to MergeContent with single header from multiple files.? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170842#M37377</link>
    <description>&lt;P&gt;@mpayne, is there a way i can check for headers from CVS files and merge all files with similar headers and route other files to failures.??&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2016 03:47:16 GMT</pubDate>
    <dc:creator>saikrishna_tara</dc:creator>
    <dc:date>2016-08-25T03:47:16Z</dc:date>
    <item>
      <title>How to MergeContent with single header from multiple files.?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170839#M37374</link>
      <description>&lt;P&gt;I am using MergeContent processor to Merge 20 small .csv files in to one file. All of them are similar with same header.&lt;/P&gt;&lt;P&gt;The files are getting merged successfully but when i opened the destination file i am seeing 20 headers (one header for each file). is there some setting that i can do where i can have header only once in the Merged file.?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 02:41:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170839#M37374</guid>
      <dc:creator>saikrishna_tara</dc:creator>
      <dc:date>2016-08-10T02:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to MergeContent with single header from multiple files.?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170840#M37375</link>
      <description>&lt;P&gt;MergeContent by itself doesn't allow you to merge parts of the FlowFiles together. However, an option that you can use is to put RouteText before MergeContent. In RouteText, set the Matching Strategy to "Satisfies Expression." Then, add a property named "header" with a value of "${lineNo:equals(1)}". Leave all others as default values. This will route the first line of each FlowFile to the "header" relationship.&lt;/P&gt;&lt;P&gt;You can then auto-terminate the "header" relationship and route "unmatched" to MergeContent. That is, filter out the header line and route everything else to Merge Content.&lt;/P&gt;&lt;P&gt;With MergeContent, you can then set "Header" to the text of your header and set "Delimiter Strategy" to "Text." This will cause MergeContent to add that header line back to the merged FlowFile for you.&lt;/P&gt;&lt;P&gt;Sorry that this is so non-trivial, but I think this approach will at least give you what you're looking for.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 02:52:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170840#M37375</guid>
      <dc:creator>mpayne</dc:creator>
      <dc:date>2016-08-10T02:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to MergeContent with single header from multiple files.?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170841#M37376</link>
      <description>&lt;P&gt;Awesome ,thanks. that worked.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 03:41:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170841#M37376</guid>
      <dc:creator>saikrishna_tara</dc:creator>
      <dc:date>2016-08-10T03:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to MergeContent with single header from multiple files.?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170842#M37377</link>
      <description>&lt;P&gt;@mpayne, is there a way i can check for headers from CVS files and merge all files with similar headers and route other files to failures.??&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 03:47:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170842#M37377</guid>
      <dc:creator>saikrishna_tara</dc:creator>
      <dc:date>2016-08-25T03:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to MergeContent with single header from multiple files.?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170843#M37378</link>
      <description>&lt;P&gt;Can't understand. Can you send overall source code for it.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 19:58:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/170843#M37378</guid>
      <dc:creator>gauravj1391</dc:creator>
      <dc:date>2017-03-01T19:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to MergeContent with single header from multiple files.?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/294896#M37379</link>
      <description>&lt;P&gt;The answer&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/36110"&gt;@mpayne&lt;/a&gt;&amp;nbsp;is correct. Only that setting the header in MergeContent doesn't include a line break at the end of header and the records. So as EL is supported please include line break at the end.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 19:57:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-MergeContent-with-single-header-from-multiple-files/m-p/294896#M37379</guid>
      <dc:creator>cvsing</dc:creator>
      <dc:date>2020-04-27T19:57:30Z</dc:date>
    </item>
  </channel>
</rss>

