I am new to Python, and I want to convert a JSON file and print it to the console. When I try to print the whole JSON it is throwing
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 20)
My code:
import json
with open('venv/Vt.json', 'r') as json_file:
parsed_json = json.load(json_file)
for idd in parsed_json:
print(idd['t_id'])
My JSON file:
{"index":{"_id":0}}
{"t_id":0,"timestamp":"2016-06-01T09:23:39Z","stat":"571","mod":"M02"}
{"index":{"_id":1}}
{"t_id":0,"timestamp":"2016-06-01T09:23:39Z","stat":"571","mod":"M02"}