我想找到一种方法,利用Python将我的JSON对象中的一个字符串转换成另一个JSON对象(嵌套),从而为我的字符串中的值添加一个键,这些值是用""分隔的。 ; ".
My current JSON object:
"reference": "#############", "messageContext": "", "from": { "number": "+#############", "name": "" "to": { "number": "#############" "message": { "text": "12302;8;6245;d517666e-41ca-459a-9b35-c49386df537b;2;2;50.8447;-4.3614;2021-04-28T22:24:12.204Z;rec123;PRD", "media": { "mediaUri": "", "contentType": "", "title": "" "custom": {} "groupings": [ "time": "2021-05-02 14:03:22", "timeUtc": "2021-05-02T12:03:22", "channel": "Sms"我想拥有的格式是这样的,我将把文本改为对象,同时增加关键值。
我试图获得的结果是 (Inside of text:" " ):
"reference": ""#############",", "messageContext": "", "from": { "number": "+"#############",", "name": "" "to": { "number": ""#############"," "message": { "text": { "APSI": "12302", "idVhl": 8, "idDrv": 6245, "GUID": "d517666e-41ca-459a-9b35-c49386df537b", "idLne": 2, "idSvc": 2, "Lat": 50.8447, "Lon": -4.3614, "Timestamp": "2021-04-28T22:24:12.204Z", "Rec": "rec123", "Env": "PRD" "media": { "mediaUri": "", "contentType": "", "title": "" "custom": {} "groupings": [ "time": "2021-05-02 14:03:22", "timeUtc": "2021-05-02T12:03:22", "channel": "Sms"