Convert JSON text (even nested ones) into CSV format using the delimiter of your choice. Output in tabular format is also available
View ToolIf this option is selected the first row of your comma separated file is assumed to be the header. The names of the properties are generated using the field values in the first row. If the option is not selected the property names are generated automatically using a numeric pattern: column 1, column 2, column 3, etc. In the latter case the first row is interpreted as raw data.
[
{
"name": "Robin Hood",
"department": "Sales",
"salary": 200
}
]
[
{
"column 1": "Name",
"column 2": "Department",
"column 3": "Salary"
},
{
"column 1": "Robin Hood",
"column 2": "Sales",
"column 3": 200
}
]
The delimiter in the input CSV is specified here. In most cases the default setting Auto Detect works fine. But, in really small CSV data with delimiters also occurring as literals, the auto detection logic might not choose the correct delimiter. In such a scenario, the delimiter can be manually specified. Following are the choices for delimiters:-
This setting governs whether or not the output is indented. The indented output is easier for humans to comprehend. On the other hand, a non-indented output is compact & smaller in size (best for transmission). So, JSON is often minified which compacts & compresses the output by removing non-essential whitespace.
{
"name": "John Doe",
"age": 69
}
{"name":"John Doe","age":69}
This decides how the property names are transformed in the output JSON. The available strategies are:-
[
{
"name": "Robin Hood",
"departmentName": "Sales",
"salary": 200
}
]
[
{
"name": "Robin Hood",
"departmentname": "Sales",
"salary": 200
}
]
[
{
"NAME": "Robin Hood",
"DEPARTMENTNAME": "Sales",
"SALARY": 200
}
]
[
{
"name": "Robin Hood",
"department_name": "Sales",
"salary": 200
}
]
[
{
"Name": "Robin Hood",
"DepartmentName": "Sales",
"Salary": 200
}
]
This decides how the JSON output is transformed and supports the following modes:-
The examples below assume the following inputName,Department,Manager,Salary
Arsene Wenger,Bar,Friar Tuck,50
Friar Tuck,Foo,Robin Hood,100
Little John,Foo,Robin Hood,100
Dimi Berbatov,Foo,Little John,50
This is the default output type. At the root of the output is a JSON array inside which there are multiple objects corresponding to a row in the input CSV.
[
{
"Name": "Arsene Wenger",
"Department": "Bar",
"Manager": "Friar Tuck",
"Salary": 50
},
{
"Name": "Friar Tuck",
"Department": "Foo",
"Manager": "Robin Hood",
"Salary": 100
},
{
"Name": "Little John",
"Department": "Foo",
"Manager": "Robin Hood",
"Salary": 100
},
{
"Name": "Dimi Berbatov",
"Department": "Foo",
"Manager": "Little John",
"Salary": 50
}
]
Here, the CSV data is transformed in a column oriented fashion. At the root of the output is a JSON object which has a property for each column in the input CSV. The value of each of these properties is a JSON array in which each item is taken from one of the data rows in the CSV.
{
"Name": [
"Arsene Wenger",
"Friar Tuck",
"Little John",
"Dimi Berbatov"
],
"Department": [
"Bar",
"Foo",
"Foo",
"Foo"
],
"Manager": [
"Friar Tuck",
"Robin Hood",
"Robin Hood",
"Little John"
],
"Salary": [
50,
100,
100,
50
]
}
Here, the output is an Array of Array with no property names whatsoever. The structure is similar to the Properties output described above. But, there are no column names associated with the output. At the root of the output is a JSON array. Inside the array there are multiple arrays each of which correspond to a row in the input CSV. This inner array in turn is made of the values in each row. The order of the items is the same as in the input CSV.
[
[
"Arsene Wenger",
"Bar",
"Friar Tuck",
50
],
[
"Friar Tuck",
"Foo",
"Robin Hood",
100
],
[
"Little John",
"Foo",
"Robin Hood",
100
],
[
"Dimi Berbatov",
"Foo",
"Little John",
50
]
]
Here, there are no arrays. The output at the root is a JSON object. Thereafter, the first column of each row becomes a property. The value of this property is another object with all the remaining columns in that row. You can think of the output as a Dictionary (in C#) or Map (in Java). The first column of each row must have unique value for this output type to give valid results.
{
"Arsene Wenger": {
"Department": "Bar",
"Manager": "Friar Tuck",
"Salary": 50
},
"Friar Tuck": {
"Department": "Foo",
"Manager": "Robin Hood",
"Salary": 100
},
"Little John": {
"Department": "Foo",
"Manager": "Robin Hood",
"Salary": 100
},
"Dimi Berbatov": {
"Department": "Foo",
"Manager": "Little John",
"Salary": 50
}
}
This is similar to Dictionary Object described above where the output at the root is a JSON object. Thereafter, the first column of each row becomes a property. The value of this property is an array as opposed to another object. The remaining values in each row become elements inside this array object.
{
"Arsene Wenger": [
"Bar",
"Friar Tuck",
50
],
"Friar Tuck": [
"Foo",
"Robin Hood",
100
],
"Little John": [
"Foo",
"Robin Hood",
100
],
"Dimi Berbatov": [
"Foo",
"Little John",
50
]
}
Comments 0