Could any body please help me to resolve this issue asap.
No - there is no such thing as 'asap' in the forums. If you need help 'asap' you need to hire a consultant.
I have written my program result into a json file but i am getting json file in below format.
but I have lot of entries to write into json finally it become unreadle format which is not very compart to read.
Is there any way to format or writing line by line into json file like below format,
Well - YOU are the one writing the file so YOU can write it in whatever format you want to use. Both of those formats can be easily read by a simple program and the first format is MORE compact than the second.
Just add a 'newline' character after every entry. You haven't posted any code so we have no way of knowing how you are writing the file now.
Depends on how you wrote it.
As noted if you are writing it yourself then you would need to change your output.
Conversely if you are using a library to serialize your object into JSON then it probably has a 'pretty print' method.