<?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>topic Re: tfileoutputjson,without data block or array creation. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331611#M100580</link>
    <description>&lt;P&gt;I created a test job that logs the full JSON input and each Employee JSON block parsed from the full input:&lt;/P&gt; 
&lt;PRE&gt;.------------------------------------------------------------------------------------------------------------------.
|                                                  #1. tLogRow_1                                                   |
+------+-----------------------------------------------------------------------------------------------------------+
| key  | value                                                                                                     |
+------+-----------------------------------------------------------------------------------------------------------+
| json | {"Employee":{"id":1,"name":"John"},"Employee":{"id":2,"name":"Sally"},"Employee":{"id":3,"name":"James"}} |
+------+-----------------------------------------------------------------------------------------------------------+

.------------------------------------------------------.
|                    #1. tLogRow_2                     |
+--------------+---------------------------------------+
| key          | value                                 |
+--------------+---------------------------------------+
| employeeJson | {"Employee":{"id":"1","name":"John"}} |
+--------------+---------------------------------------+

.-------------------------------------------------------.
|                     #2. tLogRow_2                     |
+--------------+----------------------------------------+
| key          | value                                  |
+--------------+----------------------------------------+
| employeeJson | {"Employee":{"id":"2","name":"Sally"}} |
+--------------+----------------------------------------+

.-------------------------------------------------------.
|                     #3. tLogRow_2                     |
+--------------+----------------------------------------+
| key          | value                                  |
+--------------+----------------------------------------+
| employeeJson | {"Employee":{"id":"3","name":"James"}} |
+--------------+----------------------------------------+&lt;/PRE&gt; 
&lt;P&gt;Here is a screenshot of the job:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="employee-json.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M57s.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157156iAE88C7C0625717BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M57s.png" alt="0683p000009M57s.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;Note the Xpath queries in the tExtractJSONFields component.&amp;nbsp; Because "Get Nodes" is checked, you will get all of the JSON at the node as a string, which is what you want.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here you see the output files and their contents.&amp;nbsp; I used the loop index of the iteration in the file name to create separate file names:&lt;/P&gt; 
&lt;PRE&gt;$ pwd
c:/temp

$ ls -1 Employee*
Employee1-out.json
Employee2-out.json
Employee3-out.json

$ head Employee*
==&amp;gt; Employee1-out.json &amp;lt;==
{"Employee":{"id":"1","name":"John"}}
==&amp;gt; Employee2-out.json &amp;lt;==
{"Employee":{"id":"2","name":"Sally"}}
==&amp;gt; Employee3-out.json &amp;lt;==
{"Employee":{"id":"3","name":"James"}}&lt;/PRE&gt; 
&lt;P&gt;I am attaching a zip archive of the test job so you can look at the other components to see the details.&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LvOX"&gt;TestJsonSeparateFile.zip&lt;/A&gt;</description>
    <pubDate>Mon, 27 May 2019 08:39:21 GMT</pubDate>
    <dc:creator>nfz11</dc:creator>
    <dc:date>2019-05-27T08:39:21Z</dc:date>
    <item>
      <title>tfileoutputjson,without data block or array creation.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331608#M100577</link>
      <description>&lt;P&gt;&amp;lt;p&amp;gt;Hi,&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;i am using tfileoutputjson to out a jsonfile written using twritejson , in tfileoutput there are two options either create an array object or name a data block . I dont want to use any of them i want the json to be splitted into different objects rather than being stored in an array.&amp;lt;li-image width="469" height="45" alt="problem.PNG" align="inline" id="19082i353F7878F3F8E24C" size="large" sourcetype="new"&amp;gt;&amp;lt;/li-image&amp;gt;&amp;lt;/p&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 05:27:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331608#M100577</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-24T05:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: tfileoutputjson,without data block or array creation.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331609#M100578</link>
      <description>Sorry, I don't understand&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 24 May 2019 16:31:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331609#M100578</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-24T16:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: tfileoutputjson,without data block or array creation.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331610#M100579</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;The problem i'm facing is that the tfileoutputjson combines different objects in a particular json under a single array , I want the objects to be stored in different files .&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For eg :- the output im getting is&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;[ {Employee:&amp;nbsp; &amp;nbsp;.................}, {Employee:........}]&lt;/P&gt; 
&lt;P&gt;I want the output to be&lt;/P&gt; 
&lt;P&gt;File 1 : {Employee : .........} // Details of first employee&lt;/P&gt; 
&lt;P&gt;File 2 : {Employee : .........} // Details of second employee&lt;/P&gt; 
&lt;P&gt;Can this be done using tfileoutpujson? or is there any other method to split a json array into different files in talend.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 05:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331610#M100579</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-27T05:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: tfileoutputjson,without data block or array creation.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331611#M100580</link>
      <description>&lt;P&gt;I created a test job that logs the full JSON input and each Employee JSON block parsed from the full input:&lt;/P&gt; 
&lt;PRE&gt;.------------------------------------------------------------------------------------------------------------------.
|                                                  #1. tLogRow_1                                                   |
+------+-----------------------------------------------------------------------------------------------------------+
| key  | value                                                                                                     |
+------+-----------------------------------------------------------------------------------------------------------+
| json | {"Employee":{"id":1,"name":"John"},"Employee":{"id":2,"name":"Sally"},"Employee":{"id":3,"name":"James"}} |
+------+-----------------------------------------------------------------------------------------------------------+

.------------------------------------------------------.
|                    #1. tLogRow_2                     |
+--------------+---------------------------------------+
| key          | value                                 |
+--------------+---------------------------------------+
| employeeJson | {"Employee":{"id":"1","name":"John"}} |
+--------------+---------------------------------------+

.-------------------------------------------------------.
|                     #2. tLogRow_2                     |
+--------------+----------------------------------------+
| key          | value                                  |
+--------------+----------------------------------------+
| employeeJson | {"Employee":{"id":"2","name":"Sally"}} |
+--------------+----------------------------------------+

.-------------------------------------------------------.
|                     #3. tLogRow_2                     |
+--------------+----------------------------------------+
| key          | value                                  |
+--------------+----------------------------------------+
| employeeJson | {"Employee":{"id":"3","name":"James"}} |
+--------------+----------------------------------------+&lt;/PRE&gt; 
&lt;P&gt;Here is a screenshot of the job:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="employee-json.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M57s.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157156iAE88C7C0625717BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M57s.png" alt="0683p000009M57s.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;Note the Xpath queries in the tExtractJSONFields component.&amp;nbsp; Because "Get Nodes" is checked, you will get all of the JSON at the node as a string, which is what you want.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here you see the output files and their contents.&amp;nbsp; I used the loop index of the iteration in the file name to create separate file names:&lt;/P&gt; 
&lt;PRE&gt;$ pwd
c:/temp

$ ls -1 Employee*
Employee1-out.json
Employee2-out.json
Employee3-out.json

$ head Employee*
==&amp;gt; Employee1-out.json &amp;lt;==
{"Employee":{"id":"1","name":"John"}}
==&amp;gt; Employee2-out.json &amp;lt;==
{"Employee":{"id":"2","name":"Sally"}}
==&amp;gt; Employee3-out.json &amp;lt;==
{"Employee":{"id":"3","name":"James"}}&lt;/PRE&gt; 
&lt;P&gt;I am attaching a zip archive of the test job so you can look at the other components to see the details.&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LvOX"&gt;TestJsonSeparateFile.zip&lt;/A&gt;</description>
      <pubDate>Mon, 27 May 2019 08:39:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331611#M100580</guid>
      <dc:creator>nfz11</dc:creator>
      <dc:date>2019-05-27T08:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: tfileoutputjson,without data block or array creation.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331612#M100581</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help your job is running perfectly well . Can I output these different files in a column in postgresql .&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 11:15:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331612#M100581</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-27T11:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: tfileoutputjson,without data block or array creation.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331613#M100582</link>
      <description>&lt;P&gt;Since your original question was answered, please mark this topic as solved by selecting my answer as the solution.&lt;BR /&gt;&lt;BR /&gt;You can read about the Postgres component yourself and learn how to use it.&amp;nbsp; Here is the Talend documentation for all of the Postgres components:&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://help.talend.com/reader/PEtNf6RuyCZnH5XfH7jFow/zb5SBsH8S3EnHv3PT_NY4w" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://help.talend.com/reader/PEtNf6RuyCZnH5XfH7jFow/zb5SBsH8S3EnHv3PT_NY4w&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;You can also search this forum as I am sure someone has done it before.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 12:13:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfileoutputjson-without-data-block-or-array-creation/m-p/2331613#M100582</guid>
      <dc:creator>nfz11</dc:creator>
      <dc:date>2019-05-27T12:13:48Z</dc:date>
    </item>
  </channel>
</rss>

