By YiyaoPublished
Convert a header-based file into a record array
Paste a CSV with one field name for every column, then select Convert CSV to JSON. The output has one object per input data row. In this converter each CSV field stays a string, so account codes and postal codes keep their original characters.
Check the header before converting
Use unique field names. A missing column name leaves the converter with no reliable key; two columns named id could overwrite one another in a JSON object. Fix the header and share the contract with the receiving team instead of allowing an automatic rename that the receiver does not expect.
Preview the CSV as a table to confirm that the header and sample rows have the same number of fields.
Verify a two-record conversion
For id,units followed by 0042,2 and 0043,3, the expected JSON is [{"id":"0042","units":"2"},{"id":"0043","units":"3"}]. The two IDs and quantities remain strings. If the receiving application expects numeric quantities, define that as a separate typed mapping and test it before importing.
Resolve mismatches without discarding values
| Failure or surprise | Next step |
|---|---|
| Different number of fields from the header | Check quoting and the reported row before rerunning |
| Duplicate column name | Agree on distinct names with the owner |
| Header exists but no data rows | Accept an empty array only if the receiving contract allows no records |
| Number-looking value is a string | Keep exact text unless the destination explicitly requests a typed field |
Confirm that the top-level output stays an array for a header-only file or a file with one data row.
Questions about the output
Will the result be one JSON object if I have only one row? No. A one-row output is an array containing one object.
Can I use this to turn JSON into a spreadsheet? That's the opposite direction. Start from the correct converter or the existing export guide.
Check the handoff before copying the data
Open the result and check the number of entries, two known IDs, and any quoted or blank field. Confirm the destination accepts the extracted field names and string types before processing a full export.
