| Item | Quantity |
|---|---|
| Notebook | 12 |
| Pencil | 4 |
A CSV row becomes one object, the header cells become keys, and the values are typed. true, false, and null become those JSON values. A number without a leading zero becomes a number. A token with a leading zero, such as 001, stays a string, which is how an identifier survives. Empty cells become empty strings.
The sheet name, amount, code with a first row "A, Inc.", 2, 001 produces an object whose name is A, Inc., whose amount is the number 2, and whose code is the string 001. The two following Bob rows, amount 10 and a blank code, become two objects with code as an empty string. That is three objects, not a deduped list. The analyzer would have called the code column numeric and shown 1. This page does not.
The result is pretty JSON. Nested cells are not created, because CSV has no nesting. The other direction, JSON to CSV, flattens nested objects into dotted columns.
name,amount,code then "A, Inc.",2,001 then Bob,10, then Bob,10,
Three objects. The first has name A, Inc., amount 2, and code "001". Each Bob has amount 10 and code "".
Typed values mean the JSON matches what a script expects from the sheet, with 12 as a number beside the item name.
A leading zero is not part of the JSON number grammar used here. 2 has no leading zero, so it becomes a number. The analyzer parses 001 as 1. These pages disagree on purpose.
No. It becomes an empty string. null is reserved for the literal text null.
No. Two identical Bob rows produce two objects. Drop copies first if you need one.
The cell text true, false, and null becomes the JSON values, not strings.
Yes. JSON to CSV takes an array of objects and writes rows, flattening nested objects to dotted headers.