A valid CSV input has a header row with column names, followed by data rows. Values must be separated by commas and each line represents a new record. For example:
name,age,city Alice,30,New York Bob,25,Los Angeles
The output will be a JSON array. Each CSV row becomes an object with column headers as keys. The output of the above CSV will be:
[
{
"name": "Alice",
"age": 30,
"city": "New York"
},
{
"name": "Bob",
"age": 25,
"city": "Los Angeles"
}
]Use consecutive commas (,,) to represent empty values. If the empty value
is at the end of a row, just include a trailing comma.
The empty values in the CSV will be converted as empty strings. For example:
name,age,city Alice,,
is converted to
[
{
"name": "Alice",
"age": "",
"city": ""
}
]