We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, can we able to convert the csv data below with '.' as delimiter that has a json array nested in an array
CSV:
Products.name | Products.specifications.cost | Products.discount | Products.specifications.weight | Products.type Onions | 50 | 0 | 1 | classic Onions | 200 | 0 | 2 | classic Tomato | 25 | 1 | 1 | classic Broccoli | 50 | 0 | 0.5 | classic
JSON needed as output: { "Products": [ { "name": "Onions", "specification": [ { "cost": "50", "weight": "1" }, { "cost": "200", "weight": "2" } ], "discount": "0", "type": "classic" }, { "name": "Tomato", "specification": [ { "cost": "25", "weight": "1" } ], "discount": "1", "type": "classic" }, { "name": "Broccoli", "specification": [ { "cost": "50", "weight": "0.5" } ], "discount": "0", "type": "classic" } ] }
but I m getting this output from the python : [ { "Products": { "discount": "0", "name": "Onions", "specification": { "cost": "50", "weight": "1" }, "type": "classic" } }, { "Products": { "discount": "0", "name": "Onions", "specification": { "cost": "200", "weight": "2" }, "type": "classic" } }, { "Products": { "discount": "1", "name": "Tomato", "specification": { "cost": "25", "weight": "1" }, "type": "classic" } }, { "Products": { "discount": "0", "name": "Broccoli", "specification": { "cost": "50", "weight": "0.5" }, "type": "classic" } } ]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, can we able to convert the csv data below with '.' as delimiter that has a json array nested in an array
CSV:
Products.name | Products.specifications.cost | Products.discount | Products.specifications.weight | Products.type
Onions | 50 | 0 | 1 | classic
Onions | 200 | 0 | 2 | classic
Tomato | 25 | 1 | 1 | classic
Broccoli | 50 | 0 | 0.5 | classic
JSON needed as output:
{
"Products": [
{
"name": "Onions",
"specification": [
{
"cost": "50",
"weight": "1"
},
{
"cost": "200",
"weight": "2"
}
],
"discount": "0",
"type": "classic"
},
{
"name": "Tomato",
"specification": [
{
"cost": "25",
"weight": "1"
}
],
"discount": "1",
"type": "classic"
},
{
"name": "Broccoli",
"specification": [
{
"cost": "50",
"weight": "0.5"
}
],
"discount": "0",
"type": "classic"
}
]
}
but I m getting this output from the python :
[
{
"Products": {
"discount": "0",
"name": "Onions",
"specification": {
"cost": "50",
"weight": "1"
},
"type": "classic"
}
},
{
"Products": {
"discount": "0",
"name": "Onions",
"specification": {
"cost": "200",
"weight": "2"
},
"type": "classic"
}
},
{
"Products": {
"discount": "1",
"name": "Tomato",
"specification": {
"cost": "25",
"weight": "1"
},
"type": "classic"
}
},
{
"Products": {
"discount": "0",
"name": "Broccoli",
"specification": {
"cost": "50",
"weight": "0.5"
},
"type": "classic"
}
}
]
The text was updated successfully, but these errors were encountered: