


And it is that almost all languages contain libraries or some function that can be read and written with JSON structures. This format maps easily to data structures used by most programming languages.

json which is quite similar to the XML file format, being its main alternative. In any case, I like the one line conversion, and the script even better.It is also compact and lightweight, and can be opened with most text editors, although not all allow editing. (this is a joke I hate Emacs with a passion.)Īlternatively, you can use Vim and run :set nobomb then %!python -m json.tool. Or whatever your editor of choice is, so long as it's not Emacs. Tail -c +4 $1.gamedatabundle | python -m json.tool > $1.mod.gamedatabundle Tail removes the BOM header which interferes with the python script which does the actual conversion. Once converted you can use your favorite editor to edit it. This probably doesn't work in Windows (but of course Notepad++ probably will), but it should work on Macs, and I know it works in GNU/Linux. Tail -c +4 FILE.gamedatabundle | python -m json.tool > Even if it worked for me, I would prefer the below.Īnother option for those comfortable with terminals (this is what I'll be doing) you can do the following. Note that most people probably can just use Notepad++ with the JSON plugin. Clicking the one of the left makes the text easier on the eyes. In the smallest of these pictures you see the two option buttons. This allows one to copy and paste the text beautified text on the left into your text editor of choice. What this online editor allows however is to beautify the string into something that is easier for humans to read.

I settled on for viewing, but I really don't want to rely so heavily on an online editor. I then did searches and tried Vim (my choice of editor anyway) and Geany plugins. When I asked what tools were used I was told Notepad++ with the JSON plug-in, but this didn't work. What wasn't so great was looking at an insanely long string. So I learned that game data files are in JSON string format.
