Postal codes in CSV: preserve leading zeros on import
Why a quoted CSV field can still lose zeroes in spreadsheet software, and how to make the import predictable.
AI summary
Postal codes are text identifiers. Numeric conversion removes leading zeros such as in 02108; preserve text types in databases, CSV workflows and spreadsheet imports.
Postal codes are text identifiers
A value such as 02108 is not a quantity. Converting it to a number changes the identifier to 2108. Keep the field as text in databases, application schemas, and spreadsheet import settings.
CSV quoting does not declare a type
Quotes protect delimiters and line breaks; they do not require every spreadsheet to import the cell as text. Use the import wizard and set the postal-code column to Text, or use a typed format such as JSON for a programmatic pipeline.
postal_code "02108" "00501" "SW1A 1AA" Expected after import: 02108 · 00501 · SW1A 1AA
Check the whole round trip
Test export, import, edit, and re-export with 02108, 00501, and an alphanumeric code such as SW1A 1AA. Compare the exact strings and watch for trimmed spaces, scientific notation, and locale-specific separators.
Prefer explicit schema in automated jobs
In code, parse the column as a string and validate against a country-aware rule. A valid-looking string can still be unassigned, so keep syntax validation separate from delivery verification.