I have a json file.
{"bla":"bla"}
{"bla":"bla"}
{"bla":"bla"}
{"bla":"bla"}
......
How can I format these into a valid json type, like:
[
{"bla":"bla"},
{"bla":"bla"},
{"bla":"bla"},
{"bla":"bla"},
......
{"bla":"bla"}
]
Insert comma after each {}
except last one.
How can I do that in java?
Thanks.
PS: OK. This is a json file called "1.json" which I created from TCP response. I send some names to the server and I receive response and save as a file. Because all the data is like {"bal":"bla"}{"bal":"bla"}{"bal":"bla"}{"bal":"bla"}......
This is an invalid json structure that jQuery getJSON()
couldn't read it. So I want to parse it to a valid type.