1

I've got a file containing JSON data that is about 90MB of size and has one line. I need to go to position 99376229. Unfortunately vim and less both crash when I try moving to that column.

How can I look at the content at this position or rather the data around it? I am looking for a syntax error in the data that leads to my JSON parser breaking.

I'll go for any kind of solution, also programmatical ones.

2 Answers 2

2

Python:

$ python
>>> f = open("file.json", "r")
>>> f.seek(99376229)
>>> f.read(1024)

Shell:

$ tail -c +99376229 file.json | head -c 1K

Also, try piping the file through jshon, json_pp, or json_reformat; they'll probably give better error messages.

0

Try using the cut command from GNU coreutils. It can deal with character positions as well as fields too... See
$ man 1 cut
for more details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .