question

ShambhuRai-4099 avatar image
0 Votes"
ShambhuRai-4099 asked ShambhuRai-4099 answered

Extract column namd and data from json

Hi Expert,

I getting data in unstructured format via exporting json from azure form. How to extract it using column name and data

 {"status":"succeeded","createdDateTime":"2022-05-02T08:55:55Z","lastUpdatedDateTime":"2022-05-02T08:56:05Z","analyzeResult":{"version":"2.1.0","readResults":[{"page":1,"angle":0,"width":11.6806,"height":8.2639,"unit":"inch","lines":[{"boundingBox":[0.2079,0.8619,1.673,0.8517,1.6781,1.1357,0.2079,1.1458],"text":"intertek","appearance":{"style":{"name":"other","confidence":0.878}},"words":[{"boundingBox":[0.2079,0.872,1.5665,0.8568,1.5716,1.1407,0.2079,1.1458],"text":"intertek","confidence":0.985}]},{"boundingBox":[4.6587,1.0541,9.3281,1.0541,9.3281,1.16,4.6587,1.16],"text":" QUALITY REPORT  IN SEPTEMBER 2020","appearance":{"style":{"name":"other","confidence":1}},"words":[{"text":"QUALITY","confidence":1},{"boundingBox":[6.3762,1.0541,6.8301,1.0541,6.8301,1.1456,6.3762,1.1456],"text":"REPORT","confidence":1},{"boundingBox":[6.8726,1.0541,7.0978,1.0541,7.0978,1.1456,6.8726,1.1456],"text":"FOR","confidence":1},{"boundingBox":[7.1344,1.0541,7.6076,1.0541,7.6076,1.1456,7.1344,1.1456],"text":"VESSELS","confidence":1},{"boundingBox":[7.6534,1.0541,8.1233,1.0541,8.1233,1.1456,7.6534,1.1456],"text":"LOADED","confidence":1},{"boundingBox":[8.1696,1.0553,8.2799,1.0553,8.2799,1.1444,8.1696,1.1444],"text":"IN","confidence":1},{"boundingBox":[8.3246,1.0541,9.012,1.0541,9.012,1.1456,8.3246,1.1456],"text":"SEPTEMBER","confidence":1},{"boundingBox":[9.0524,1.0541,9.3281,1.0541,9.3281,1.1456,9.0524,1.1456],"text":"2020","confidence":1}]},{"boundingBox":}],"errors":[]}}

could you please help with Pycode to extract column name and from it

azure-form-recognizer
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, thanks for reaching out. This blog tutorial may be useful for your scenario and includes sample code. You can also try using JSONPath python library, here's an example. Please check them out.


0 Votes 0 ·

1 Answer

ShambhuRai-4099 avatar image
0 Votes"
ShambhuRai-4099 answered

have used the above option and getting below output

{
"status": "success",
"pages": [
{
"number": 1,
"height": 841,
"width": 595,
"clusterId": 0,
"keyValuePairs": [
{
"key": [
{
"text": "XXXXX",
"boundingBox": [
415.3,
778.6,
564.5,
778.6,
564.5,
765.4,
415.3,
765.4
]
}
],
"value": []
},
{
"key": [
{
"text": "Abendmarkt 2",
"boundingBox": [
81.0,
681.3,
137.5,
681.3,
137.5,
672.6,
81.0,
672.6
]
}
],
"value": [
{
"text": "XXXX",
"boundingBox": [
80.7,
670.6,
151.1,
670.6,
151.1,
661.1,
80.7,
661.1
],
"confidence": 1.0
}
]
},
{
"key": [
{
"text": "Datum:",
"boundingBox": [
361.1,
635.0,
393.4,
635.0,
393.4,
625.5,
361.1,
625.5
]
}
],
"value": [
{
"text": "27.06.2019",
"boundingBox": [
489.5,
635.2,
539.0,
635.2,
539.0,
625.5,
489.5,
625.5
],
"confidence": 1.0
}
]
},

          ],
         "tables": []
     }
 ],
 "errors": []

}



How to parse data from this to get proper table structure


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.