如何将旧json从logic_1、logic_2所有键名重命名为logic(删除下划线和序列号)(ps:json文件中的数据通过循环get多数据)
[
{
"logic_1": "NOT",
"StudyDescription": "",
"SeriesDescription": "C\\+",
"ImageComments": ""
},
{
"logic_2": "NOT",
"StudyDescription": "\\-C",
"SeriesDescription": "\\-C",
"ImageComments": "\\-C"
}
]
到
[
{
"logic": "NOT",
"StudyDescription": "",
"SeriesDescription": "C\\+",
"ImageComments": ""
},
{
"logic": "NOT",
"StudyDescription": "\\-C",
"SeriesDescription": "\\-C",
"ImageComments": "\\-C"
}
]
您可以像这样寻找要更换的钥匙
1.您可以使用正则表达式匹配密钥 2.然后在dict中添加一个新的键值。 3.然后删除旧的键值对
相关问题 更多 >
编程相关推荐