
Anonymous
Not applicable
2016-06-01
06:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to output JSON records in multiple rows
Hi Experts,
I have generated a JSON output file using Talend. However, my problem is that all my records are outputted in 1 row in the JSON file. Below is the sample output:
My desired output is to have all JSON record separated by newline in the output file:
Thanks in advance for the feedback and help.
I have generated a JSON output file using Talend. However, my problem is that all my records are outputted in 1 row in the JSON file. Below is the sample output:
My desired output is to have all JSON record separated by newline in the output file:
Thanks in advance for the feedback and help.
480 Views
7 Replies

Anonymous
Not applicable
2016-06-01
02:08 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
replace "}," with "},\n"
480 Views

Anonymous
Not applicable
2016-06-01
03:34 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
replace "}," with "},\n"
Thanks for the feedback.
But how do I process JSON file as plain text? When I try to process it, it is always filtered by column. For example, when I try to process the string, records are usually separated by field (field1, field2, field3) and not the whole string ( {"field1":"value1_1","field2":"value2_1","field3":"value3_1"},{"field1":"value1_2","field2":"value2_2","field3":"value3_2"},{"field1":"value1_3","field2":"value2_3","field3":"value3_3"})
480 Views

Anonymous
Not applicable
2016-06-02
04:26 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After you wrote the json file, open it raw (tfileinputraw), read as string, searchn´replace in a tjavarowcomponent, write raw.
Take care about the Encoding
Take care about the Encoding
480 Views

Anonymous
Not applicable
2016-06-02
06:38 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh dear... string manipulation to transform JSON? Seriously?
Why do you need to pretty print the output this way. For a technical usage of the file this does not makes sense. For the human read you can use tools which formats the file in a human readable way.
I would never ever manipulating the json content which such error prone methods.
Why do you need to pretty print the output this way. For a technical usage of the file this does not makes sense. For the human read you can use tools which formats the file in a human readable way.
I would never ever manipulating the json content which such error prone methods.
480 Views

Anonymous
Not applicable
2016-06-02
08:57 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We really need some sort of +1 or Like mechanism in here jlolling 🙂
I have to say I agree with Jan, but maybe you can explain why you need the JSON in that format ctufindgood? It does seem like a weird requirement, but I have also had many weird requirements from clients 🙂
I have to say I agree with Jan, but maybe you can explain why you need the JSON in that format ctufindgood? It does seem like a weird requirement, but I have also had many weird requirements from clients 🙂
480 Views

Anonymous
Not applicable
2016-06-03
05:58 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jolli: hopy you didn´t called me a dear ...
480 Views

Anonymous
Not applicable
2016-06-05
10:51 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi jlolling and rhall2.0,
Yes, it is for a technical usage. It needs to accept data in the format of JSON, but the separator (",") actually needs to be replaced by newline character (\n).
Many Thanks.
Yes, it is for a technical usage. It needs to accept data in the format of JSON, but the separator (",") actually needs to be replaced by newline character (\n).
Many Thanks.
480 Views
