I am a bit of an idiot in programming and Python. I know that there are many explanations in previous questions about this, but I carefully read them all and I could not find a solution.
I am trying to read a JSON file containing about 1 billion data, such as:
334465|{"color":"33ef","age":"55","gender":"m"}
334477|{"color":"3444","age":"56","gender":"f"}
334477|{"color":"3999","age":"70","gender":"m"}
I tried to overcome these 6-digit numbers at the beginning of each line, but I don’t know how I can read multiple JSON objects? Here is my code, but I can not find why it is not working?
import json
T =[]
s = open('simple.json', 'r')
ss = s.read()
for line in ss:
line = ss[7:]
T.append(json.loads(line))
s.close()
And here is the error I received:
ValueError: Extra Data: line 3 column 1 - line 5 column 48 (char 42 - 138)
Any suggestion would be very helpful for me!
source
share