'How to find position in large JSON file

I have a very large JSON file that I am trying to parse through with Eclipse. Unfortunately, I keep getting the error of:

Unexpected token LEFT BRACE({) at position 1029.

I downloaded the free version of Liquid Studio to be able to look at the JSON file without crashing. However, I was wondering if anyone knew how to find that particular LEFT BRACE at position 1029 to find it quickly and fix it along with any other possible future occasions in which I may come across other unexpected tokens.

Thank you for your help and time.



Solution 1:[1]

The offset will be shown in the status line in the upcoming release, Eclipse 2019-09 (4.13) which will be released tomorrow (September 18, 2019):

See Eclipse 4.13 - New and Noteworthy - New features in the Platform and Equinox - Editor status line shows more selection details

As far as I know, unfortunately, there is no Go to Offset command yet similar to the Go to Line (Ctrl+L) command.

Solution 2:[2]

Open NotePad ++ >> Go to language Menu >>josn format >> Copy and paste Json file >>

Then Cntrl+Home >>Cntrl+G >> select Offset >> Enter json position.

Happy Learning .

Solution 3:[3]

You could open the JSON file with Atom and install the pretty-json plugin. Once the plugin is installed, pressing command-shift-J (on Mac) will cause Atom to attempt to format your JSON file. If the JSON is malformed, it'll display an error message showing you the bad characters in your JSON.

If you just want to see the characters around where the bad character is, assign the JSON to a string in your favorite language and use substring:

String json = "{"some-long": "json-string"}";
// Print the 10 characters before and after the bad character at 1029, which should help you debug
System.out.println(json.substring(1020, 1040));

Solution 4:[4]

Open NotePad ++ >> Go to language Menu >>josn format >> Copy and paste Joson file >>

Then Cntrl+Home >>Cntrl+G >> select Offset >> Enter json position.

Happy Learning .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 howlger
Solution 2 Sathish
Solution 3 Daniel Kesner
Solution 4 Sathish