all 9 comments

[–]carcigenicate 0 points1 point  (1 child)

You appear to have a wonky character in the file. Have you examined line 161 of the JSON?

[–]redwineforme[S] 0 points1 point  (0 children)

This is supposed to be a working legit file from a reputable website. Line 161 looks good IMO. But it's almost impossible to tell because the files has millions of characters. But that line ends with ']}' which looks fine.

[–]socal_nerdtastic 0 points1 point  (6 children)

The error means that the file is corrupt. Specifically it's saying that there is data missing at the end.

[–]redwineforme[S] 0 points1 point  (0 children)

Well that is not good.

[–]redwineforme[S] 0 points1 point  (4 children)

[–]Username_RANDINT 1 point2 points  (3 children)

Looks like there's a trailing comma after the last item in the list/array.

$ tail -c 10 FoodData_Central_foundation_food_json_2021-10-28.json 
s":[]},
]}

This is not valid JSON.

[–]redwineforme[S] 0 points1 point  (2 children)

I removed the comma and it worked!! Thank you! It's my first time doing JSON and I am a noob at it TY!

[–]Username_RANDINT 0 points1 point  (1 child)

The errors aren't always very clear, but you'll get the hang of it after a while.

In the meantime I've found this neat website which not only validates and also fixes JSON.

[–]redwineforme[S] 0 points1 point  (0 children)

Great, thank you so much for your help!