我有一个JSON数据:
{
"module": {
"data": {
"deliverySummary_200648721592191#address": {
"fields": {
"address": "MyAddress",
"consignee": "MyName",
"phone": "MyPhone",
"postCode": "",
"title": "Alamat Pengiriman \\r\\n"
},
"id": "200648721592191#address",
"tag": "deliverySummary",
"type": "biz"
}
}
}
}
我想提取这一部分:
{
"fields": {
"address": "MyAddress",
"consignee": "MyName",
"phone": "MyPhone",
"postCode": "",
"title": "Alamat Pengiriman \\r\\n"
},
"id": "200648721592191#address",
"tag": "deliverySummary",
"type": "biz"
}
我已经尝试了jq '.module.data.deliverySummary_200648721592191#address'
,但它只返回null
而不是我想要的部分,我该如何解决?
答案 0 :(得分:0)
您应该在问题属性键周围添加双引号,例如'.module.data."deliverySummary_200648721592191#address"'
。
查看游乐场结果here。