CSV to JSON
Use a CSV header to turn the following records into named JSON properties.
Use a CSV header to turn the following records into named JSON properties.
How to use
- Paste the full sample, including the quoted line break and the last record.
- Convert the table to JSON and inspect the objects in the resulting array.
- Find the first note and verify that the final record appears as its own object.
Worked example
Input
id,note
001,"line 1
line 2"
002,"Hello, world"Expected result
[{"id":"001","note":"line 1\nline 2"},{"id":"002","note":"Hello, world"}]Check the result
The embedded newline remains inside the note, and cell values such as leading-zero IDs stay strings.