SPARKPOND / GUIDE
How to Preserve Leading Zeros in CSV Files
Leading zeros disappear when identifiers are interpreted as numbers rather than text.
Problem symptoms
- 000123 becomes 123.
- Long IDs appear in scientific notation.
Why it happens
- Spreadsheet auto-typing.
- Automatic JSON number conversion.
- Unsafe integer precision limits.
Example before and after
Before
customer_id 000123 9007199254740993
After
customer_id "000123" "9007199254740993"
Procedure
- Keep identifier columns as text.
- Disable automatic numeric conversion.
- Preview JSON or XLSX typing.
- Verify the first and longest identifiers after export.
Common mistakes
- Converting every digit-only column to number.
- Opening and resaving in a spreadsheet before checking import settings.
Other possible solutions
- Use the spreadsheet text-import setting for identifier columns.
Important limitations
- A zero already lost by the source application cannot be inferred reliably.