0

I have generated a JSON output using Talend. However, my problem is that all my records are outputed in 1 row in the JSON file. Below is the sample output:

[{"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"}]

My desired output is to have all JSON record separated by newline in the output file:

[{"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"}]

Thanks in advance for the help!

1
  • 1
    Being a curious person and all, I have to ask, why do want to achieve this, how will it help you? Commented Jun 1, 2016 at 9:13

2 Answers 2

1

There is no direct way to do it, but if it's necessary you can re-read the file as raw file using a tFileInputRaw component then replace all },{ by },\n{ in a tJavaRow component.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi, How do I re-read the file as raw file using tJavaRow component?
@DanielLee Updated answer !
0

Use the tFileOutputJSON component, which will help collect the rows as a list into JSON file. You may then use a tFileInput Component to read it and send it as Response.

1 Comment

It seems more like a comment. Provide some explanation to your answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.