Hi ,
I am trying to parse below JSON object output from a web server. This JSON object has just one entry but actual object has many entries. The problem is the way array is structured especially the desired key:value pair that I am looking at, are not in an appropriate format, as explained below:
Explanation:
Code Snippet from below JSON object:
{
"@columnnumber": "0",
"@name": "RequestNum",
"text": {
"0": "AG00106"
}
},
Where,
"@name": "RequestNum" the column name i.e. key is "RequestNum"
"0": "AG00106" the column value i.e. value is "AG00106"
Is there a way I could transpose or change the out put so I could see something as following:
Desired Result in Python Object: { "RequestNum":"AG00106", "$1":"Alan Gosnell",.....}
Total number of columns are 28. Indexing starts with "0"
JSON Object Code Snippet
{
"@timestamp": "20200930T170223,92Z",
"@toplevelentries": "162",
"viewentry": [
{
"@position": "1",
"@unid": "B9AA53A48E4EFB208525858500684EA4",
"@noteid": "47C6",
"@siblings": "162",
"entrydata": [
{
"@columnnumber": "0",
"@name": "RequestNum",
"text": {
"0": "AG00106"
}
},
{
"@columnnumber": "1",
"@name": "$1",
"text": {
"0": "Alan Gosnell"
}
},
{
"@columnnumber": "2",
"@name": "Submitted",
"datetime": {
"0": "20200101T000000,00-05"
}
},
{
"@columnnumber": "3",
"@name": "Status",
"text": {
"0": "Open"
}
},
{
"@columnnumber": "4",
"@name": "$3",
"datetime": {
"0": "20200101T000000,00-05"
}
},
{
"@columnnumber": "5",
"@name": "$5",
"text": {
"0": "Alan Gosnell"
}
},
{
"@columnnumber": "6",
"@name": "BusArea",
"text": {
"0": "Logistics"
}
},
{
"@columnnumber": "7",
"@name": "$2",
"text": {
"0": "Brian Ramstetter"
}
},
{
"@columnnumber": "8",
"@name": "AreaOfImprovement",
"text": {
"0": "Productivity"
}
},
{
"@columnnumber": "9",
"@name": "Subject",
"text": {
"0": "SXe PORM OERM - multiple - needs a wholistic evaluation"
}
},
{
"@columnnumber": "10",
"@name": "Detail",
"text": {
"0": ""
}
},
{
"@columnnumber": "11",
"@name": "Savings",
"text": {
"0": ""
}
},
{
"@columnnumber": "12",
"@name": "BusPriority",
"text": {
"0": "Medium"
}
},
{
"@columnnumber": "13",
"@name": "ROIType",
"text": {
"0": ""
}
},
{
"@columnnumber": "14",
"@name": "Action",
"text": {
"0": "System Application"
}
},
{
"@columnnumber": "15",
"@name": "ApplicationImpacted",
"text": {
"0": "Warehouse Link"
}
},
{
"@columnnumber": "16",
"@name": "Comments",
"text": {
"0": ""
}
},
{
"@columnnumber": "17",
"@name": "ApplicationAssignComments",
"text": {
"0": ""
}
},
{
"@columnnumber": "18",
"@name": "AppCompleteAction",
"text": {
"0": ""
}
},
{
"@columnnumber": "19",
"@name": "AppCompleteComments",
"text": {
"0": "7"
}
},
{
"@columnnumber": "20",
"@name": "TrainingAssignComments",
"text": {
"0": ""
}
},
{
"@columnnumber": "21",
"@name": "TrainingCompleteComments",
"text": {
"0": ""
}
},
{
"@columnnumber": "22",
"@name": "TSCCompleteComments",
"text": {
"0": ""
}
},
{
"@columnnumber": "23",
"@name": "ReturnReason",
"text": {
"0": ""
}
},
{
"@columnnumber": "24",
"@name": "ReviewDate",
"text": {
"0": ""
}
},
{
"@columnnumber": "25",
"@name": "InProcessDate",
"text": {
"0": ""
}
},
{
"@columnnumber": "26",
"@name": "CompletedDate",
"text": {
"0": ""
}
},
{
"@columnnumber": "27",
"@name": "ClosedDate",
"text": {
"0": ""
}
}
]
}