JSON files
by iran-amin - Friday, March 24, 2017, 04:31:55

The json files are corrupted.

I tried to open it in R, I got this error:

Error in parse_con(txt, bigint_as_char) : parse error: trailing garbage
":1,"gamestate_id":4687346} {"player":{"hand":[{"attack":4,
                      (right here) ------^

I pick a small portion (5 gamestate_IDs) of the file and try to view it with "http://www.jsoneditoronline.org/" I got similar error:

Error: Parse error on line 1:
...state_id":4687346}
{"player":{"hand":[{
----------------------^
Expecting 'EOF', '}', ',', ']', got '{'

I opened the same file in Tableau, it only shows the first gamestate.
It seems that between the first gamestate_id and the second one there should be a special charechter that is missed.

Regards,
Amin

Re: JSON files
by janek - Friday, March 24, 2017, 09:41:15

Dear Amin,

please note that the provided files with game descriptions are not in the JSON format. They are text files which in each row have a JSON record. If you take any single row of the provided files, it will be a proper JSON describing a game state.

I realize that it might be a bit confusing... I can provide you a script in R for converting the data chunks into JSON files if you like.

Best regards,
Andrzej

Re: JSON files
by iran-amin - Sunday, March 26, 2017, 05:49:45

I got it. Thank you so much Andrzej for the clarification.

Re: JSON files
by kamilcz - Thursday, April 20, 2017, 16:33:08

You can get familiar with jq command line tool -  https://stedolan.github.io/jq/