I have a object which looks like this e.g. (its in a list of objects)
{
name: "Freddy",
Age: 25,
animals: {
dogname: "Woofa",
dogname2: "bark"}
}
I have a list of these objects which look similar to how the above is structured. What I want to do is serialize the whole list of objects like so:
line1: {name:"Freddy", Age: 25, animals:{dogname: "Woofa", dogname2: "bark"}}
Now I can get it in a none formatted format, but essentially what I need is something like:
line1: {name:"Freddy", Age: 25, animals:{dogname: "Woofa", dogname2: "bark"}}
line2: {name:"Sam", Age: 56, animals:{dogname: "sludge"}}
......
and so on. What I am doing is serialising to a JSON file if that adds to more background information. How do I get each list when it is serialised to have a newline, between each object in the file.