Przechodzenie między JSON a CSV
- Format
- Konwersja
JSON is convenient for programs but a table suits people totalling things. Conversely, table data needs to be JSON to be handed to a program. Here is how to combine JSON formatted with Format and Validate JSON and the CSV conversion tool.
Flow (JSON → table)
- Format the JSON with this tool and check it's correct.
- Paste the tidy JSON into "JSON → CSV" of the CSV/JSON conversion tool.
- Convert to CSV, save and open in Excel.
Flow (table → JSON)
- Copy the Excel table and convert it with "CSV → JSON" in the CSV/JSON conversion tool.
- Format the resulting JSON with this tool and check it's correct.
- If needed, compress with "Make one line".
JSON shapes that can be converted
A form where data with the same items is lined up is easy to convert to a table. Nested parts, when converted to a table, go into one cell as text.
Benefits of combining
- Conversion errors can be prevented in advance
- You can understand the data's structure through formatting before converting
- The converted JSON can be formatted at once
Dobre do
- Totalling API results in Excel
- Turning Excel data into web app data
- Managing configuration data as a table
Cautions
- What a table can handle is flat structures. Flatten deep nesting first, or extract the needed parts.
- The distinction between numbers and strings can change in conversion.
Przykład
Formatted JSON from an API with this tool to see its structure. Finding that the needed items were outside the nesting, it converted straight to CSV and could be totalled in Excel.
Common stumbling blocks
- Nested items go into one cell: reshape first.
- Date and number formats change: set the format on the Excel side.
- Garbled text: specify the encoding when opening in Excel.
Frequently asked questions
Which tool comes first?
On receiving JSON, first format and check. Then convert.
Podsumowanie
Use JSON formatting and checking in combination with conversion to CSV.
Użyj „Formatowanie i walidacja JSON” (za darmo)Narzędzia, które dobrze z tym współgrają
- Konwersja CSV i JSON: Natychmiast konwertuj między CSV a JSON.
- Konwersja plików i Base64: Konwertuj między plikami a tekstem Base64.
- Usuwanie duplikatów wierszy i sortowanie listy: Usuń zduplikowane wiersze i posortuj je.
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)