P Pachuquin Member Licensed User Longtime User Sep 4, 2013 #1 I need to parse an invalid JSON file and this is the error: Code: Copy { "language": "English", "score": "", <-This comma is invalid }, That comma is invalid and the file has several of them. How can i remove all of them? Thanks
I need to parse an invalid JSON file and this is the error: Code: Copy { "language": "English", "score": "", <-This comma is invalid }, That comma is invalid and the file has several of them. How can i remove all of them? Thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2013 #2 Can you upload the full JSON file? Upvote 0
P Pachuquin Member Licensed User Longtime User Sep 5, 2013 #3 Erel said: Can you upload the full JSON file? Click to expand... I'm sorry, but i can't post the full file, but believe me the problem is the commas before curly brackets. How can i remove them? Maybe with a regex? Thanks Upvote 0
Erel said: Can you upload the full JSON file? Click to expand... I'm sorry, but i can't post the full file, but believe me the problem is the commas before curly brackets. How can i remove them? Maybe with a regex? Thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2013 #4 I was thinking about regex as well. However without seeing more examples it is difficult to find the correct pattern. Alternatively you can go over all the string one character after another and find the problematic cases and remove them (or not add them to the StringBuilder). Upvote 0
I was thinking about regex as well. However without seeing more examples it is difficult to find the correct pattern. Alternatively you can go over all the string one character after another and find the problematic cases and remove them (or not add them to the StringBuilder).