Basic CSV → JSON
Input: id,name,email,active
1,Ada Lovelace,ada@example.com,true
2,Alan Turing,alan@example.com,false
Output: [
{"id":1,"name":"Ada Lovelace","email":"ada@example.com","active":true},
{"id":2,"name":"Alan Turing","email":"alan@example.com","active":false}
]
Quoted commas and apostrophes
Input: company,city,note
"Acme, Inc.","New York","O'Brien said ""hi"""
Globex,Springfield,"Multi
line"
Output: [
{"company":"Acme, Inc.","city":"New York","note":"O'Brien said \"hi\""},
{"company":"Globex","city":"Springfield","note":"Multi\nline"}
]
JSON → CSV (reverse)
Input: [{"sku":"A-1","qty":3,"price":19.99},{"sku":"B-2","qty":1,"price":4.50}]
Output: sku,qty,price
A-1,3,19.99
B-2,1,4.5