开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 244|回复: 3
收起左侧

[已解决] 求一个把下面数据解析的例子

 关闭 [复制链接]
结帖率:66% (19/29)
发表于 2024-9-5 15:11:44 | 显示全部楼层 |阅读模式   云南省文山壮族苗族自治州
50精币
var observe24h_data = {"od":{"od0":"101290603007","od1":"","od2":[{"od21":"14","od22":28.8,"od23":"180","od24":"南风","od25":1,"od26":0,"od27":54,"od28":29.5},{"od21":"13","od22":27.9,"od23":"90","od24":"东风","od25":1,"od26":0,"od27":61,"od28":26.2},{"od21":"12","od22":26.8,"od23":"90","od24":"东风","od25":0,"od26":0,"od27":73,"od28":26.1},{"od21":"11","od22":24,"od23":"135","od24":"东南风","od25":1,"od26":0,"od27":87,"od28":18.9},{"od21":"10","od22":21.8,"od23":"270","od24":"西风","od25":0,"od26":0,"od27":96,"od28":3.6},{"od21":"09","od22":20,"od23":"135","od24":"东南风","od25":0,"od26":0,"od27":99,"od28":2.6},{"od21":"08","od22":19.3,"od23":"90","od24":"东风","od25":1,"od26":0,"od27":99,"od28":0.8},{"od21":"07","od22":19.6,"od23":"45","od24":"东北风","od25":1,"od26":0,"od27":99,"od28":0.9},{"od21":"06","od22":19.4,"od23":"45","od24":"东北风","od25":1,"od26":0,"od27":98,"od28":2.2},{"od21":"04","od22":22.3,"od23":"270","od24":"西风","od25":0,"od26":0,"od27":80,"od28":17.2},{"od21":"03","od22":22.3,"od23":"270","od24":"西风","od25":0,"od26":0,"od27":80,"od28":17.2},{"od21":"02","od22":20.7,"od23":"90","od24":"东风","od25":0,"od26":0,"od27":97,"od28":17.2},{"od21":"01","od22":21,"od23":"45","od24":"东北风","od25":0,"od26":0,"od27":96,"od28":19.3},{"od21":"00","od22":21.3,"od23":"90","od24":"东风","od25":0,"od26":0,"od27":95,"od28":30.6},{"od21":"23","od22":21.6,"od23":"0","od24":"北风","od25":0,"od26":0,"od27":94,"od28":32.4},{"od21":"22","od22":22.1,"od23":"90","od24":"东风","od25":1,"od26":0,"od27":94,"od28":20.8},{"od21":"21","od22":22.4,"od23":"270","od24":"西风","od25":0,"od26":0,"od27":93,"od28":24.7},{"od21":"20","od22":23.6,"od23":"180","od24":"南风","od25":1,"od26":0,"od27":90,"od28":25.6},{"od21":"19","od22":24.1,"od23":"135","od24":"东南风","od25":1,"od26":0,"od27":83,"od28":23.9},{"od21":"18","od22":23.5,"od23":"225","od24":"西南风","od25":1,"od26":0,"od27":82,"od28":3.4},{"od21":"17","od22":23.9,"od23":"135","od24":"东南风","od25":1,"od26":11.6,"od27":72,"od28":30.4},{"od21":"16","od22":23.9,"od23":"135","od24":"东南风","od25":1,"od26":0.3,"od27":72,"od28":30.4},{"od21":"15","od22":29.6,"od23":"0","od24":"北风","od25":0,"od26":0,"od27":54,"od28":30.4},{"od21":"14","od22":29,"od23":"325","od24":"西北风","od25":1,"od26":0,"od27":53,"od28":29.1},{"od21":"13","od22":28,"od23":"270","od24":"西风","od25":1,"od26":0,"od27":58,"od28":31.8}]}};
     把"od21"和"od26"的所有的值提前出来

最佳答案

查看完整内容

.版本 2 .局部变量 Json, zyJson .局部变量 l, 整数型 .局部变量 od21, 文本型 .局部变量 od26, 长整数型 Json.解析 (#常量1) .计次循环首 (Json.取成员数 (“od2”), l) od21 = Json.取文本 (“od.od2[” + 到文本 (l - 1) + “].od21”) od26 = Json.取长整数 (“od.od2[” + 到文本 (l - 1) + “].od26”) .计次循环尾 () ...

回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至 资源分享区 可获得加分喔。
友情提醒:本版被采纳的主题可在 申请荣誉值 帖子申请荣誉值,获得 3点 荣誉值,荣誉值可兑换终身vip用户组哦。
快捷通道:申请荣誉值无答案申请取消悬赏投诉有答案未采纳为最佳
结帖率:86% (6/7)

签到天数: 11 天

发表于 2024-9-5 15:11:45 | 显示全部楼层   湖南省长沙市
.版本 2

.局部变量 Json, zyJson
.局部变量 l, 整数型
.局部变量 od21, 文本型
.局部变量 od26, 长整数型

Json.解析 (#常量1)
.计次循环首 (Json.取成员数 (“od2”), l)
    od21 = Json.取文本 (“od.od2[” + 到文本 (l - 1) + “].od21”)
    od26 = Json.取长整数 (“od.od2[” + 到文本 (l - 1) + “].od26”)
.计次循环尾 ()

评分

参与人数 1荣誉 +3 收起 理由
笨潴 + 3 热心帮助他人,荣誉+3,希望继续努力(*^__^*) 嘻嘻!

查看全部评分

回复

使用道具 举报

结帖率:94% (17/18)

签到天数: 9 天

发表于 2024-9-5 15:21:13 | 显示全部楼层   台湾省台北市
成员数 遍历一下就出来了
回复

使用道具 举报

结帖率:100% (4/4)

签到天数: 23 天

发表于 2024-9-5 16:24:47 | 显示全部楼层   广东省深圳市
https://wwtt.lanzn.com/i9hfe298tsda  引用火山模块就可以直接用
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:wp@125.la
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表