vladikk / JSON2CSV

Utility to convert json files to csv
Other
38 stars 23 forks source link

Question: Specify from witch level to start. #2

Closed epiblue closed 8 years ago

epiblue commented 8 years ago

Hello, I'm a begginer with this kind of operations, so please, forgive me for my ignorance.

I need a little help to convert the JSON file to CSV.

Here's the structure that we have: { "291785197178": { "marketplace": "Spain", "identifiers": { "item_id": 291785197178, "sku": "prestashop-248", "ean": "", "upc": "", "epid": "", "isbn": "", "brand_mpn": { "brand": "", "mpn": "" } } } }

Your code works, but it only gets the "291785197178" values, how cna I start from the 2nd or 3rd level? Is it posible?

Thank you,

vladikk commented 8 years ago

Hi Artur,

Try wrapping your json object in an array:

[ { "291785197178": { "marketplace": "Spain", "identifiers": { "item_id": 291785197178, "sku": "prestashop-248", "ean": "", "upc": "", "epid": "", "isbn": "", "brand_mpn": { "brand": "", "mpn": "" } } } } ]

On Tue, Jul 5, 2016 at 1:36 PM, Artur notifications@github.com wrote:

Hello, I'm a begginer with this kind of operations, so please, forgive me for my ignorance.

I need a little help to convert the JSON file to CSV.

Here's the structure that we have: { "291785197178": { "marketplace": "Spain", "identifiers": { "item_id": 291785197178, "sku": "prestashop-248", "ean": "", "upc": "", "epid": "", "isbn": "", "brand_mpn": { "brand": "", "mpn": "" } } } }

Your code works, but it only gets the "291785197178" values, how cna I start from the 2nd or 3rd level? Is it posible?

Thank you,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vladikk/JSON2CSV/issues/2, or mute the thread https://github.com/notifications/unsubscribe/ABtK_5Ei8guBzwulER4_Z1iDgbBvCQmTks5qSjO3gaJpZM4JE_J8 .