Переход между JSON и CSV
- Формат
- Конвертировать
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
Подходит для
- 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.
Пример
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.
Итог
Use JSON formatting and checking in combination with conversion to CSV.
Использовать «Форматировать и проверить JSON» (бесплатно)Инструменты, которые хорошо сочетаются с этим
- Преобразовать CSV и JSON: Мгновенно преобразуйте между CSV и JSON.
- Преобразование файлов и Base64: Преобразуйте между файлами и текстом Base64.
- Удалить повторяющиеся строки и отсортировать список: Удалите повторяющиеся строки и отсортируйте их.
Если это руководство помогло, небольшие чаевые будут очень ценны.
Отправить чаевые (¥300)Отправить подарок (список желаний Amazon)