convert data to json file
If we have a data set like this :
branchID : BID0
issuer_country : EG
issuer_governate : Port Said
issuer_type : B
issuer_name : Issuer
receiver_country : EG
receiver_governate : New Cairo, Cairo
issuer_type : B
receiver_name : Receiver
How can we generate it in Json format exactly like this :
{
"documents": [
{
"issuer": {
"address": {
"branchID": "BID0",
"country": "EG",
"governate": " Port Said"
},
"type": "B",
"name": "Issuer"
},
"receiver": {
"address": {
"country": "EG",
"governate": " New Cairo, Cairo "
},
"type": "B",
"name": "Receiver"
}
}
]
}