如何用公式提取关键信息(温度35度,风力5级)?如下所示

语句容易实现还是公式容易实现?咋写?   温度:38度,风力:0级

取温度以及温度后面value值,取风力以及风力后面value值,只取温度和风力,怎么用公式写呢?温度和38之间字符串个数是有规律的  不变的

{"unit":"ug/m³","monitorid":10001093,"name":"TSP","time":"2024-07-29 14:45:00","value":8,"sensorid":24},{"unit":"dB","monitorid":10001093,"name":"噪声","time":"2024-07-29 14:45:00","value":58.1,"sensorid":23},{"unit":"℃","monitorid":10001093,"name":"温度","time":"2024-07-29 14:44:00","value":38,"sensorid":1},{"unit":"kPa","monitorid":10001093,"name":"大气压","time":"2024-07-29 14:44:00","value":131.08,"sensorid":3},{"unit":"%RH","monitorid":10001093,"name":"湿度","time":"2024-07-29 14:44:00","value":59.2,"sensorid":2},{"unit":"级","monitorid":10001093,"name":"风力","time":"2024-07-29 14:44:00","value":0,"sensorid":82}]

FineReport 张宇 发布于 2024-7-29 15:52 (编辑于 2024-7-29 15:52)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共3回答
最佳回答
0
CD20160914Lv8专家互助
发布于2024-7-29 16:08

"温度:"+INDEXOFARRAY(SPLIT(INDEXOFARRAY(SPLIT(INDEXOFARRAY(SPLIT(a1,"温度"),2),"\"value\":"),2),","),1)+"  风力:"+INDEXOFARRAY(SPLIT(INDEXOFARRAY(SPLIT(INDEXOFARRAY(SPLIT(a1,"风力"),2),"\"value\":"),2),","),1)

image.png

最佳回答
0
privacyLv5初级互助
发布于2024-7-29 16:00(编辑于 2024-7-29 16:19)

直接用公式处理完整的json

image.png

image.png

JSONPathFinder公式使用

最佳回答
0
用户k6280494Lv6资深互助
发布于2024-7-29 16:33

image.png

"温度:"+ REPLACE(mid(INDEXOFARRAY(SPLIT(a2,"sensorid"),3),find("value",INDEXOFARRAY(SPLIT(a2,"sensorid"),3))+7,4),",\"","") + "   风力:"+REPLACE(mid(INDEXOFARRAY(SPLIT(a2,"sensorid"),6),find("value",INDEXOFARRAY(SPLIT(a2,"sensorid"),6))+7,4),",\"","")

  • 4关注人数
  • 254浏览人数
  • 最后回答于:2024-7-29 16:33
    请选择关闭问题的原因
    确定 取消
    返回顶部