×
Menu

How to convert JSON to CSV

 
Use the "JSON | Convert JSON to CSV file..." command to convert JSON input to CSV tables. This command is enabled after selecting a file in the built-in "File Explorer" or an active document is loaded on the Editor tab. To start the conversion a dialog is opened that offers various options in a convenient way:
How to convert JSON to CSV
1

Take only top-level objects

1. Take only top-level objects
Only JSON objects from the root level are taken to generate the CSV output. Can also be used if the top-level value is a JSON array.
2

Take objects at  JSON pointer

2. Take objects at  JSON pointer
If not the complete JSON should be converted to CSV this option can be used to set a JSON pointer to set the location where the conversion process should start.
3

JSON pointer field

3. JSON pointer field
JSON pointer to set the location in the input where the conversion process should start. See also (2)
4

Take from selection

4. Take from selection
This button is enabled if the current document is converted to CSV and a valid JSON pointer for the current selection is available. On clicking this button the current JSON pointer is copied to the JSON pointer field
5

Only objects named

5. Only objects named
Use this option if only objects with a specific name at the starting level shall be converted to CSV.
6

Include child objects  and values

6. Include child objects  and values
Select this option to convert the complete JSON with all child objects and values. The column labels are then JSON pointers pointing to the related values relative to the starting level of the JSON input. Please take a look at the List of JSON values and the CSV preview to get a better idea how the JSON is converted to CSV in this case.
7

List of JSON values

7. List of JSON values
This list contains all of the JSON values which will be converted to CSV. You can add values using the Add and Remove buttons. The column labels are actually JSON pointer fragments relative to the starting level within the JSON input.
8

Add value

8. Add value
Use this button to manually add a JSON value (by name) to the CSV output.
9

Remove value

9. Remove value
Button to remove a selected JSON value from the CSV output.
10

Up button

10. Up button
Moves the JSON value position to the front in the CSV output line.
11

Down button

11. Down button
Moves the JSON value position to the end in the CSV output line.
12

Update preview

12. Update preview
The CSV output preview is refreshed using the current conversion options.
13

CSV preview

13. CSV preview
 
14

CSV column delimiter

14. CSV column delimiter
The CSV export supports three different column separators:
  • Semicolon
  • Comma
  • Tabulator
15

Create header row

15. Create header row
Add a header line with column labels to the CSV output.
16

Output encoding

16. Output encoding
Please select the encoding that should be used on writing the CSV output. By default a standard ASCII encoding is selected.
17

Convert button

17. Convert button
 
 
In general the conversion process takes all JSON objects it can find at a specific location in the JSON document. This location can be the root of the JSON data or any other valid JSON pointer.
 
A list of JSON values is updated whenever the starting location of the conversion process is changed. This list can also be used to change the order in the CSV output, to remove values from the output and to add values which were not detected automatically. Use the "Remove" button to skip a JSON value in the CSV output. In order to move a value up or down select the value from the list and use the "Up" or "Down" buttons.
The "Take from selection" button is enabled if the dialog was opened from an active document on the Editor tab. In this case the JSON pointer location is taken from the current selection in the JSON data.
 
To generate the actual output use the "Convert" button. This will open a new document in the editor with the conversion results as CSV. Afterwards you can save the CSV data with the standard "File | Save" command.
 
Error reporting
 
It can happen that not all of the JSON input can be converted to CSV. For example, the JSON input could have syntax errors at a specific line. Any available CSV output is written to a new document and the standard "Results" window of the application will then display all of the reported errors. Please note that not all of the JSON input is converted in this case.