CSV is an old & very popular format for storing tabular data. It has been used in the desktop as well as mainframe. It is a simple & compact format that works really well for tabular data and so is still in use today.
JavaScript Object Notation (JSON), pronounced as Jason, is the most common data interchange format on the web. Douglas Crockford first released the JSON specification in the early 2000s. It is a simple format that is easier to comprehend than XML. It is also smaller in size because it does not have closing tags. A wide variety of programming languages can parse JSON files. They also support the serialization of data structures to JSON. You can copy JSON text to JavaScript and start using them without any modifications.
The examples below assume the following input:-
Name,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
[ { "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 } ]
{ "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 ] }
[ [ "Arsene Wenger", "Bar", "Friar Tuck", 50 ], [ "Friar Tuck", "Foo", "Robin Hood", 100 ], [ "Little John", "Foo", "Robin Hood", 100 ], [ "Dimi Berbatov", "Foo", "Little John", 50 ] ]
{ "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 } }
{ "Arsene Wenger": [ "Bar", "Friar Tuck", 50 ], "Friar Tuck": [ "Foo", "Robin Hood", 100 ], "Little John": [ "Foo", "Robin Hood", 100 ], "Dimi Berbatov": [ "Foo", "Little John", 50 ] }
[ { "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 } ]
{ "name": "John Doe", "age": 69 }
{"name":"John Doe","age":69}
[ { "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 } ]