<?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: JSON split and then converted to CSV before being merged together again? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189107#M76131</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/70187/mcgmark87.html" nodeid="70187" target="_blank"&gt;@Mark McGowan&lt;/A&gt;&lt;P&gt;You need to change the &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Delimiter Strategy
&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Text&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt; set
&lt;STRONG&gt;Demarcator property&lt;/STRONG&gt; value to &lt;STRONG&gt;New line(shift + enter)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="65396-mergecontent.png" style="width: 1752px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18583iE886ADD62B5255D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="65396-mergecontent.png" alt="65396-mergecontent.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then you can get the merged file contents in new lines.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The merged output flowfile will looks like below with the above properties&lt;/P&gt;&lt;PRE&gt;2018,1,12,3,0,0&lt;BR /&gt;2018,1,12,2,0,0&lt;/PRE&gt;</description>
    <pubDate>Sun, 18 Aug 2019 07:46:01 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T07:46:01Z</dc:date>
    <item>
      <title>JSON split and then converted to CSV before being merged together again?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189104#M76128</link>
      <description>&lt;P&gt;Hi, i'm very new to NiFi and i was hoping for some advice. I'm taking in some JSON data which i'm assuming needs to be split before i can successfully convert it to CSV and then merge together again. json.png shows the JSON data before it has been converted, csv.png shows the data after its been converted and merged back together and desiredCSV.png shows what i want the csv file to look like.&lt;/P&gt;&lt;P&gt;I'm currently using SplitJson  -&amp;gt; EvaluateJsonPath -&amp;gt; ReplaceText -&amp;gt; MergeContent. Iv'e tried using the ConvertRecord processor but i can't seem to configure it properly.&lt;/P&gt;&lt;P&gt;This is the flow for one record, i then need to do the same thing with over a hundred other records and merge them all together into one big CSV file!?&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64709-desiredcsv.png" style="width: 578px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18586iDA6F6F337258D721/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64709-desiredcsv.png" alt="64709-desiredcsv.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64707-json.png" style="width: 207px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18587iE891CD4B6B012804/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64707-json.png" alt="64707-json.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/7504iFEC7F8481C27B710/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="csv.png" title="csv.png" /&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:46:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189104#M76128</guid>
      <dc:creator>mcgmark87</dc:creator>
      <dc:date>2019-08-18T07:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: JSON split and then converted to CSV before being merged together again?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189105#M76129</link>
      <description>&lt;P&gt;Your flow looks fine to me. The only thing that you need to take care of it merging ALL the fragments while using MergeContent. So use Defragment merge strategy. This will pick ALL the flow files created from a single document by SplitJson and will make sure that all of them are merged before moving further. Follows a sample MergeContent config.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64711-screen-shot-2018-03-19-at-50056-pm.png" style="width: 786px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18585i011DDB91424FF3E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64711-screen-shot-2018-03-19-at-50056-pm.png" alt="64711-screen-shot-2018-03-19-at-50056-pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Let know if that works for you or if you need any other help.&lt;/P&gt;&lt;P&gt;PS - If you need any help with your existing flow, refer to &lt;A href="https://community.hortonworks.com/articles/64069/converting-a-large-json-file-into-csv.html" rel="nofollow noopener noreferrer" target="_blank"&gt;this link&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:46:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189105#M76129</guid>
      <dc:creator>RahulSoni</dc:creator>
      <dc:date>2019-08-18T07:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: JSON split and then converted to CSV before being merged together again?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189106#M76130</link>
      <description>&lt;P&gt;Hi Rahul, thanks for your prompt reply. Unfortunately the resulting CSV file is still being merged in the same manner. see following snippet.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64712-csv.png" style="width: 1061px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18584i57E3BD6BC98D0E10/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64712-csv.png" alt="64712-csv.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;as you can see i don't have the heading and all csv files are being appended onto the one line.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:46:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189106#M76130</guid>
      <dc:creator>mcgmark87</dc:creator>
      <dc:date>2019-08-18T07:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: JSON split and then converted to CSV before being merged together again?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189107#M76131</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/70187/mcgmark87.html" nodeid="70187" target="_blank"&gt;@Mark McGowan&lt;/A&gt;&lt;P&gt;You need to change the &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Delimiter Strategy
&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Text&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt; set
&lt;STRONG&gt;Demarcator property&lt;/STRONG&gt; value to &lt;STRONG&gt;New line(shift + enter)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="65396-mergecontent.png" style="width: 1752px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18583iE886ADD62B5255D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="65396-mergecontent.png" alt="65396-mergecontent.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then you can get the merged file contents in new lines.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The merged output flowfile will looks like below with the above properties&lt;/P&gt;&lt;PRE&gt;2018,1,12,3,0,0&lt;BR /&gt;2018,1,12,2,0,0&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:46:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189107#M76131</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T07:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: JSON split and then converted to CSV before being merged together again?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189108#M76132</link>
      <description>&lt;P&gt;Thanks Shu, that worked perfect.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 05:54:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189108#M76132</guid>
      <dc:creator>mcgmark87</dc:creator>
      <dc:date>2018-03-20T05:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: JSON split and then converted to CSV before being merged together again?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189109#M76133</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/70187/mcgmark87.html" nodeid="70187"&gt;@Mark McGowan&lt;/A&gt;&lt;P&gt;You can do merging by using Correlation attribute name property in merge content processor, to use this property we cannot use convert record processor because each flowfile we need to keep date,hour attrbiutes as one attribute and use the attribute in merge content correlation attribute name. Then the merge content processor will merge with same attribute flowfiles into one flowfile.&lt;/P&gt;&lt;P&gt;Please refer to below links for more details about correlation attribute usage&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/161827/mergeprocessor-nifi-using-the-correlation-attribut.html" target="_blank"&gt;https://community.hortonworks.com/questions/161827/mergeprocessor-nifi-using-the-correlation-attribut.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/55926/using-the-mergecontent-processor-in-nifi-can-i-use.html" target="_blank"&gt;https://community.hortonworks.com/questions/55926/using-the-mergecontent-processor-in-nifi-can-i-use.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/87178/merge-fileflow-files-based-on-time-rather-than-siz.html" target="_blank"&gt;https://community.hortonworks.com/questions/87178/merge-fileflow-files-based-on-time-rather-than-siz.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For reference Convert record xml&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/64825-178086-json-to-csv.xml"&gt;178086-json-to-csv.xml&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Mar 2018 23:50:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/JSON-split-and-then-converted-to-CSV-before-being-merged/m-p/189109#M76133</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-03-24T23:50:16Z</dc:date>
    </item>
  </channel>
</rss>

