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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

DB to JSON file

I am using talend to create json file from a database table.

Talend creates the file as below 

[{"Col1":"Val1"},{"Col2":"Val2"},{"Col3":"Val3"}]

 

But I need the file to be in below format

{"Col1":"Val1"}

{"Col2":"Val2"}

{"Col3":"Val3"}

 

Because this is how its accepted in target.

Any way to make this work. I can use tWriteJSONField but I have to map it manually. There are multiple tables and I want to make this as a framework which can accept table names as context variable and produce the json in the above format. Any suggestions?

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi Stevens
Take a look at tNormalize component.
https://help.talend.com/reader/LNO9Tqm8svZQklRyXL8OYw/yV2ZEYW9mADj~cYLcbhFWA
After you generate the Json file, read the whole file as a string using tFileInputRaw, remove the characters "[","]", and then normalize the line to multiple lines.

Regards
Shong