Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Merge output of two job in a single output file

Hi All,

How to merge two job output in a single output file.I am adding screenshot of my job:

0683p000009M0SX.png

I have to merge tFileOutputDelimited_3 and tFileOutputDelimited_4 out put in a single output file.Thanks in advance. 

 

 

Labels (2)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

because You are attaching as a source my example (sure not the best way, but it was created fast on one of the projects)

 

You can see below on the same page - for convert csv (comma delimited) string, I read from a file as \t (TAB) delimited, in this case, all row it a single column

 

If You check other links, You can create more elegant code of course

 

P.S.

You always could use csvkit, I use it as well from talend for different reasons

View solution in original post

13 Replies
vapukov
Master II
Master II

why just not append to first file?

Anonymous
Not applicable
Author

Vinayak,

 

If the schema for both the files/flows are same you can use tUnite component to combine the result set.

 

In case of different schema, you could append the resultset.

 

In the first file remove "Throw an error if the file exist" in advanced setting of tFileOutputDelimited so the the file will be overwritten for every iteration. make sure "append" is unchecked in basic settings.

 

In the second file should be appended by checking "append" in basic settings.

 

Regards,

Ragu

Anonymous
Not applicable
Author

How will we append that, will you please guide me or suggest me.
Anonymous
Not applicable
Author

 

In tFileOutputDelimited_4,  go to basic settings then check (tick) the "Append" and make sure the

"File Name" is same for both tFileOutputDelimited_3. below is the screen shot.

 

0683p000009M0T6.png

Anonymous
Not applicable
Author

Hi arragupathy,

 

As per your suggestion i have appended successfully. Now i got a output as a delimited file:

0683p000009M0TV.png

Now i have to generate a json file of it, like this:

 

0683p000009M0Ta.pngIs there any way to achieve it, as this file having no schema define. Thanks in advance. 

vapukov
Master II
Master II


@vinayak019 wrote:

Hi arragupathy,

 

As per your suggestion i have appended successfully. Now i got a output as a delimited file:

0683p000009M0TV.png

Now i have to generate a json file of it, like this:

 

0683p000009M0Ta.pngIs there any way to achieve it, as this file having no schema define. Thanks in advance. 


it possible to write java code for this

https://dzone.com/articles/how-to-convert-csv-to-json-in-java

https://stackoverflow.com/questions/19766266/directly-convert-csv-file-to-json-file-using-the-jackso...

 

or use something ready to use -

https://csvkit.readthedocs.io/en/1.0.3/ 

https://csvkit.readthedocs.io/en/1.0.3/scripts/csvjson.html?highlight=csvjson

 

Anonymous
Not applicable
Author

Hi Vapukov,

 

I was using your suggested approach in https://community.talend.com/t5/Design-and-Development/need-to-convert-delimited-file-to-key-value-p... this.

So my job design like this:0683p000009M0Ld.png

 

 

 

I have replaced '|' delimited with ',', so input file is like that only:0683p000009M0Tp.png

 tFileInputDelimited_2 setting:0683p000009M0Tl.png

 

 

tJavaFlex_1 code:0683p000009M0Tu.png

 

 

now again, OnComponentOk, tFileInputDelimited_3 setting:0683p000009M0Tz.png

 

 

tjavaFlex_2 setting:0683p000009M0T2.png

 

 

tJavaFlex_3 setting:

0683p000009M0U4.png

 

 

output of this job is:0683p000009M0U9.png

 

 

Why it is creating json for first record only. my expectation is:


0683p000009M0Ta.pngWhere I am doing mistake, please let me know.

 

 

 

 

vapukov
Master II
Master II

think You are not read till the end of page 

 

find on page text about delimiter 🙂

Anonymous
Not applicable
Author

Hi,

Will you please explain a little more, not getting it exactly.