Synthetic worked example · Maintained by Data Demon Systems
CSV Import Traps: Leading Zeros, Quotes & Multiline Fields
Keep CSV identifiers such as 001 intact and inspect quoted commas, escaped quotes and multiline fields with a downloadable synthetic fixture.
Inspect a CSV without changing its identifiers
- Download the synthetic fixture below, then open CSV Viewer and choose that local file. Alternatively, use “Open example in tool” to open the shared example immediately.
- Use the comma delimiter and keep the header enabled. The three columns are
id,titleandnotes. - Inspect the first row. Its identifier is the text
001, its title isQuoted, value, and its notes contain an embedded newline. - Inspect the second row. Its identifier is
002and its title isEscaped "quote". - If exporting JSON or JSONL, keep optional type inference off to preserve these identifiers as strings. Preview and export locally, then reopen the result to verify the values.
Expected results
The fixture has three columns and two data rows, even though the first notes field spans two physical lines. Splitting on every newline would break that logical row; splitting on every comma would break its quoted title.
Data Demon Systems maintains this synthetic input alongside the browser's built-in multiline CSV example. Its record expectations follow RFC 4180. An edit uses an overlay and does not overwrite the source file.
Why Excel can remove leading zeros from a CSV
A CSV stores field text, not spreadsheet column types. The source can contain 001 while Excel interprets it as the number 1. CSV quotation protects separators and line breaks; it does not declare an identifier column to be text.
- Check the original CSV in this viewer or a text editor before saving an altered spreadsheet over it.
- In Excel, import with Data → From Text/CSV instead of opening the file directly. Where available, turn off automatic data type detection so columns start as Text.
- Use Transform Data (or Edit in some versions) to set identifier columns to Text. Replace an automatic numeric type-conversion step rather than converting its already-changed result back to text.
- Confirm that the import preview still contains
001and002before loading the sheet. Menu names vary by Excel version.
See Microsoft's leading-zero guidance and Text/CSV import options. Cell display formatting is not evidence that exported CSV values are intact. If an earlier export has already changed 001 to 1, this viewer cannot recover the missing zeros; return to the original data.
Convert CSV to JSON or JSONL while preserving identifiers
- Choose Show all if you want both fixture rows; otherwise the active filters determine which rows are exported.
- Select Export rows and choose JSON or JSONL in Format. Leave Safely infer JSON primitive types unchecked. Keep redaction categories unselected for this synthetic example.
- Select Preview export. Check for
"id":"001"and"id":"002": both identifiers must be JSON strings, not numbers. The notes field's newline is escaped within its JSON string. - Select Export locally, then reopen JSON in Online JSON Viewer & Formatter or JSONL in JSONL & NDJSON Viewer Online. Verify the two identifiers and notes again.
Type inference is an explicit option, not a requirement for conversion. Keeping it off leaves every field as a string. JSONL exports one complete JSON value per line; an embedded newline in a field is escaped and does not create another record.
Open a large CSV without changing identifiers
- Choose the local file rather than pasting the entire document. File indexing reads in chunks and displays virtual rows; paste input is limited to 10 MiB.
- Check Delimiter and header settings against the source. Override an incorrect detection and let the viewer rebuild the index.
- Search for a known identifier and select Apply filters. Inspect the matching row's fields; use Show all before an export intended to contain the whole file.
- Preview a filtered or complete export, preserving identifier strings as above. The download is a derivative; your original file remains unchanged.
For a column-by-column walkthrough using this fixture, see how to filter a large CSV file without Excel.
The supported source limit is 4 GiB, not a promise that every device processes that size equally quickly. Supporting browsers can stream an export to a file handle; the fallback Blob download is capped at 100 MB. This two-row fixture tests record correctness, not throughput.
The versioned CSV evidence and benchmark method document reproducible inputs. Preserve the browser version, machine details and complete benchmark output with any timing claim.
Limitations
This fixture is UTF-8 CSV with a comma delimiter and a header. Other delimiters can be overridden and reindexed. CSV is not a spreadsheet: formulas, row insertion, global sorting and arbitrary legacy encodings are outside this workflow. Header names must be unique when exporting objects as JSON.
For newline-delimited JSON output, continue with JSONL & NDJSON Viewer Online to inspect the resulting records.
Complete synthetic fixture
id,title,notes
001,"Quoted, value","Line one
Line two"
002,"Escaped ""quote""","CRLF rows remain logical records"