clip-indonesian / data /check_json.py
Galuh Sahid
Check json
9658f76
raw
history blame
No virus
375 Bytes
import json
import sys
file_name = sys.argv[1]
with open(file_name, 'r') as json_file:
json_list = list(json_file)
for json_str in json_list:
try:
result = json.loads(json_str)
# print(f"result: {result}")
if not isinstance(result, dict):
print(json_str)
except Exception as e:
print(json_str)
print(e)