1

I have a huge unformatted JSON file - size is around 2.5G. Is there any tool or way to write script that can help me to format this file into well-readable indented format? I have PC with Intel Core i7 and 16GB memory, so it is more-less that elevated hardware requirement should not be an issue.

ivan.ukr
  • 2,853
  • 1
  • 23
  • 41

3 Answers3

2

You may try Webstorm. I haven't tried it with such a large file, but Webstorm is able to handle really big files. There is a 30 day trial version, so you may give it a try.

Once you've opened the file in Webstorm click Code-> Reformat Code.

Hope this helps. Cheers!

dj2bee
  • 146
  • 9
0

My advice is to use Jackson Streaming API. Since it is streaming it will read token by token of your JSON file and will not consume too much memory.

An example of streaming API can be found on this link.

Milan
  • 1,780
  • 1
  • 16
  • 29
-2

There is an online tool - https://conversiontools.io/convert/format-json which is able to format JSON files of up to 100 GB.

But there are limits for free usage - at the moment of writing it's only possible to convert files (for free) up to 20MB.

drdmitry
  • 21
  • 5