Note sul JSON annidato
- Incolla
- Controlla
JSON from APIs and the like often has a "nested" form, where data contains further data. Here are cautions for converting nested JSON to CSV with Convert CSV and JSON.
Passaggi
- For "Direction", choose "JSON → CSV".
- Paste the JSON into "Before conversion".
- Press "Convert".
- Check "After conversion".
What nesting is
For example, data like this.
- Name: Yamada
- Address: (prefecture: Tokyo, city: Shinjuku)
Inside "Address" are further items. That is nesting.
The result after conversion
CSV is a flat table. Nested parts cannot take a table form, so their content goes into a single cell as text.
Ways to flatten
- Expand the items: bring the contents of the address out as separate items "prefecture" and "city".
- Fix with a text editor: change the structure with find-and-replace and so on.
- Extract just the needed parts: make JSON with only the target items.
How much to fix
- The values inside the nesting aren't needed → fine as it is
- You want to total the values inside the nesting in Excel → flatten before converting
Nested arrays (lists)
When one item holds several values (a list), it also goes into one cell as text. If you want rows split per list element, reshape first.
Adatto a
- Converting simply structured JSON (no nesting)
- When it is enough to see the nested contents as they are
Esempio
Converted order data JSON. The "products" item held a list of products and went into one cell as text. To total per product, reshaped it to one row per product first and converted again.
Common stumbling blocks
- A cell is full of brackets and symbols: that is the nested part.
- The number of columns differs by row: data with uneven items.
Frequently asked questions
Can nesting be expanded automatically?
This tool does not expand nesting. Reshape first.
Riepilogo
Nesting goes into one cell as text. If you want to total it, flatten first.
Usa “Converti CSV e JSON” (gratis)Strumenti che si abbinano bene a questo
- Rimuovi le righe duplicate e ordina un elenco: Rimuovi le righe duplicate e ordinale.
- Crea un file ZIP: Comprimi più file in un solo ZIP.
- Conta caratteri (per candidature e relazioni): Conta caratteri, righe e fogli da manoscritto del tuo testo.
Se questa guida ti è stata utile, una piccola mancia sarebbe molto apprezzata.
Invia una mancia (¥300)Invia un regalo (lista desideri Amazon)