【发布时间】:2019-09-09 21:25:22
【问题描述】:
我正在尝试通过获取数据功能将我的 json 文件导入到 excel 中。执行此操作时,我收到一条错误消息,提示“我们在 JSON 输入的末尾发现了额外的字符”
我在 jsonformatter 中运行了 json 文件并得到了这条额外的信息:
第 1 行的解析错误: ...s":"1555615338756"} {"created_at":"星期四 ----------------------^ 期待 'EOF'、'}'、','、']',得到 '{'
编辑:第 1 行
{"created_at":"Thu Apr 18 19:22:18 +0000 2019","id":1118957948263206913,"id_str":"1118957948263206913","text":"阿森纳球衣看起来很奇怪。#NapoliArsenal", "来源":"\u003ca href=\"https://mobile.twitter.com\" rel=\"nofollow\"\u003eTwitter Web App\u003c/a\u003e","截断":false,"in_reply_to_status_id" :null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":955479430377373696,"id_str":"955479430377373696","name": "Yash Iyer","screen_name":"MesutOziI28","location":"Bengaluru South, India","url":null,"description":"RM,Nerazzurri,BFC,RCB,bcci,rafa nadal 等等!最近进入 B99,超市!对推文表示同情!","translator_type":"none","protected":false,"verified":false,"followers_count":258,"friends_count":454,"listed_count": 0,"favourites_count":47788,"statuses_count":5318,"created_at":"Mon Jan 22 16:37:02 +0000 2018","utc_offset":null,"time_zone":null,"geo_enabled":false, "lang":"en","contribu tors_enabled":false,"is_translator":false,"profile_background_color":"F5F8FA","profile_background_image_url":"","profile_background_image_url_https":"","profile_background_tile":false,"profile_link_color":"1DA1F2","profile_sidebar_border_color" :"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://pbs.twimg.com/profile_images/1109886916609007616/9rAavtGh_normal.jpg" ,"profile_image_url_https":"https://pbs.twimg.com/profile_images/1109886916609007616/9rAavtGh_normal.jpg","profile_banner_url":"https://pbs.twimg.com/profile_banners/955479430377373696/1544903252","default_profile" :true,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors": null,"is_quote_status":false,"quote_count":0,"reply_count":0,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[{"text":"NapoliArsenal" ,"索引":[28,42]}],"网址":[],"user_mentions":[],"symbols":[]},"favorited":false,"retweeted":false,"filter_level":"low","lang":"en","timestamp_ms ":"1555615338756"}
【问题讨论】:
-
呃...修复 JSON 以便验证?不完全确定 JSON 来自哪里,也不知道“获取数据函数”是什么。
-
如果错误出现在第 1 行,那么可能有助于显示第 1 行的全部内容?你的 JSON 来自哪里?
-
再看一遍,问题是你必须在没有分隔符的情况下使用花括号...
5338756"} {"created_。根据第 1 行的开头,您很可能需要在结尾和大括号之间使用逗号 -
@ScottHoltzman 将其作为回答;鉴于上下文,这是我能看到的唯一答案...应该能够将其从未回答列表中删除
-
似乎有Relaxed JSON 样本。我猜 get data 函数需要标准 JSON。