简体   繁体   中英

Trying to use json load with txt file

import json f=open("99_jiayi.txt",'r',encoding = 'utf-8-sig') a=json.load(f) f.close()

https://i.stack.imgur.com/vD3M5.png

https://i.stack.imgur.com/QP0oW.png

I tried to turn the text file into a list in order to analyze the data

I used the "json load" and it worked on another file which is written in the same mode

But when i want to use it on another file it comes out the error

i searched google for a lot of time but still cant get the ans

Hope someone can help me with this question

i have some problem to express my thought with eng so if anyone cant understand what i am typing plz let me know tks!!

The error message points to "1":NR, which does not look like valid JSON, so it seems like a valid error.

Edit: try putting all NR within quotes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM