Uwagi o zagnieżdżonym JSON
- Wklej
- Sprawdź
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.
Kroki
- 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.
Dobre do
- Converting simply structured JSON (no nesting)
- When it is enough to see the nested contents as they are
Przykład
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.
Podsumowanie
Nesting goes into one cell as text. If you want to total it, flatten first.
Użyj „Konwersja CSV i JSON” (za darmo)Narzędzia, które dobrze z tym współgrają
- Usuwanie duplikatów wierszy i sortowanie listy: Usuń zduplikowane wiersze i posortuj je.
- Tworzenie pliku ZIP: Spakuj kilka plików do jednego ZIP-a.
- Licznik znaków (do podań i prac): Policz znaki, wiersze i arkusze rękopisu w swoim tekście.
Jeśli ten poradnik Ci pomógł, mały napiwek będzie dla nas ogromnym wsparciem.
Wesprzyj nas napiwkiem (¥300)Wyślij prezent (lista życzeń Amazon)