Hello,
I've got a Json file formatted like this :
{ "FIRST_ITEM":[ {"line1": "Hello" }, {"line2": "world" } ], "SECOND_ITEM":[ { "line1" : "This is" }, { "line2" : "my first" }, { "line3":"Json ccp" }, { "line4":"project" } ],
When I'm trying to call Parse function it return a false value.
I feel that this function was not designed to work with this file structure. Is anyone have the same problem?
Thanks for you answers!
Hi yoypi.
What you have there isn't propertly formatted JSON. You shouldn't have commas after } and ]. Commas are used to separate items within {} and .
Also it looks like you are missing the closing } for the first {
I think my paste snipet was not correctly formatted. My JSON file is formatted like this (I hope it works!)
{ "FIRST_ITEM":[ {"line1": "Hello" }, {"line2": "world" } ], "SECOND_ITEM":[ { "line1" : "This is" }, { "line2" : "my first" }, { "line3":"Json ccp" }, { "line4":"project" } ]
Get rid of the commas. Try this:
{ "FIRST_ITEM":[ {"line1": "Hello" } {"line2": "world" } ] "SECOND_ITEM":[ { "line1" : "This is" } { "line2" : "my first" } { "line3":"Json ccp" } { "line4":"project" } ] }
JSON syntax is defined at www.json.org
Sorry, ignore my previous reply. The commas are needed, but you are missing a '}' at the end. Try this:
{ "FIRST_ITEM":[ {"line1": "Hello" }, {"line2": "world" } ], "SECOND_ITEM":[ { "line1" : "This is" }, { "line2" : "my first" }, { "line3":"Json ccp" }, { "line4":"project" } ] }
Sorry, I've forgot to put the } at the end of the sample file but in my "real" file I've put it!
I found the problem in my file a comma whas missing!! Thanks for your help.
Log in to post a comment.
Hello,
I've got a Json file formatted like this :
When I'm trying to call Parse function it return a false value.
I feel that this function was not designed to work with this file structure. Is anyone have the same problem?
Thanks for you answers!
Hi yoypi.
What you have there isn't propertly formatted JSON. You shouldn't have commas after } and ]. Commas are used to separate items within {} and .
Also it looks like you are missing the closing } for the first {
I think my paste snipet was not correctly formatted. My JSON file is formatted like this (I hope it works!)
Get rid of the commas. Try this:
JSON syntax is defined at www.json.org
Sorry, ignore my previous reply. The commas are needed, but you are missing a '}' at the end. Try this:
Sorry, I've forgot to put the } at the end of the sample file but in my "real" file I've put it!
I found the problem in my file a comma whas missing!! Thanks for your help.