I like to convert this txt to json file like the format I attached.
here my txt: `
WarehouseId WarehouseName SKU NUMBER SKU Name rackSection gatewayID tagAddress lightActive caseCount
50 Lakewood 45234 Mountain Dew (20oz) 4 1 1 True 24
50 Lakewood 65197 Dr Pepper (20oz) 5 1 2 True 24
50 Lakewood 45206 Diet Dr Pepper (20oz) 5 1 3 True 24
50 Lakewood 65209 Diet Pepsi (20oz) 6 1 4 True 24
I tried to use data.split(" ")
but after that Idk what is the next step and how to make it to json file.
this is the result I like to achieve ( a json file ) :
[
{
"warehouseId" : 50,
"WarehouseName":"Lakewood",
"SKU NUMBER":45234,
"SKU Name":"Mountain Dew (20oz)",
"rackSection":4,
"gatewayID":1,
"tagAddress":1,
"lightActive":"True",
"caseCount":24
},
{
"warehouseId" : 50,
"WarehouseName":"Lakewood",
"SKU NUMBER":65197,
"SKU Name":"Dr Pepper (20oz)",
"rackSection":5,
"gatewayID":1,
"tagAddress":2,
"lightActive":"True",
"caseCount":24
},
{
"warehouseId" : 50,
"WarehouseName":"Lakewood",
"SKU NUMBER":45206,
"SKU Name":"Diet Dr Pepper (20oz)",
"rackSection":5,
"gatewayID":1,
"tagAddress":3,
"lightActive":"True",
"caseCount":24
},
{
"warehouseId" : 50,
"WarehouseName":"Lakewood",
"SKU NUMBER":65209,
"SKU Name":"Diet Pepsi (20oz)",
"rackSection":6,
"gatewayID":1,
"tagAddress":4,
"lightActive":"True",
"caseCount":24
}
]```
Many thanks.