- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 JSON,即使使用在线解析器也无法传输:-/我已经尝试过这个,但出现错误
df <- fromJSON("data/part-f1.json", simplifyVector = TRUE, simplifyDataFrame = simplifyVector, simplifyMatrix = simplifyVector, flatten = FALSE)
错误
Error in parse_con(txt, bigint_as_char) : parse error: trailing garbage
6b967967c8","type":"custom"} {"ts":1512318029084,"userid":"5
(right here) ------^
示例 JSON:
{"ts":1512317797740,"userid":"51a35e52c6fba44bd8edba65778c607e","sessionid":"4691122171951068866","remote_ip":"93.72.204.143","platform":"AndroidPlayer","sdk_ver":"u2017 .1.1f1","debug_device":false,"user_agent":"Dalvik/2.1.0 (Linux; U; Android 7.0; XT1650 Build/NPLS25.86-30-5)","submit_time":1512292759927,"名称":"邮箱已激活","custom_params":null,"appid":"4dfb4d07-b463-43d4-ba0b-4c6b967967c8","type":"custom"}{“ts”:1512318029084,“userid”:“51a35e52c6fba44bd8edba65778c607e”,“sessionid”:“4691122171951068866”,“remote_ip”:“93.72.204.143”,“平台”:“AndroidPlayer”,“sdk _ver":"u2017.1.1f1 ","debug_device":false,"user_agent":"Dalvik/2.1.0 (Linux; U; Android 7.0; XT1650 Build/NPLS25.86-30-5)","submit_time":1512292986741,"name":"车轮更换","custom_params":{"车轮尺寸":"17","车轮名称":"Ratikon"},"appid":"4dfb4d07-b463-43d4-ba0b-4c6b967967c8","类型":"自定义”}{“ts”:1512287567257,“userid”:“3996da04b2fef4ac7bf3a47c5b149625”,“sessionid”:“5914000471379591192”,“remote_ip”:“90.178.242.246”,“平台”:“AndroidPlayer”,“sd k_ver":"u2017.1.1f1 ","debug_device":false,"user_agent":"Dalvik/2.1.0 (Linux; U; Android 5.1.1; HUAWEI M2-A01W Build/HUAWEIM2-A01W)","submit_time":1512287567576,"name": "场景已输入","custom_params":{"场景名称":"_Scenes/intro_scene"},"appid":"4dfb4d07-b463-43d4-ba0b-4c6b967967c8","type":"custom"}
正如你所看到的,在 onlineparser 中我得到了多个根错误。我需要根据这个 JSON 创建一个数据框,但我确实需要帮助。谢谢
最佳答案
也称为ndjson
您也可以使用更快且专门构建的 ndjson::stream_in()
。
关于json - 如何在R中解析奇怪格式的JSON,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48304706/
我是一名优秀的程序员,十分优秀!