Skip to content
Technology

Before You Sort a CSV: Check Its Delimiters, Dates, and ID Numbers

Before sorting a CSV in Excel or Google Sheets, check how its columns, dates, identifiers, and number formats were imported. A quick comparison with the original can catch quiet changes.

3D illustration of a spreadsheet import preview being checked for columns, dates, and a leading zero.
Inspect the import before sorting so you can compare the spreadsheet with the original CSV.

Why check a CSV before sorting?

A spreadsheet may interpret a value differently from the way it appears in the source file.

To import a CSV correctly, preview how its fields split, confirm what its dates mean, and protect identifier-like values before sorting. Then compare a few rows with the original file. These checks help you catch common import changes before they affect a report, contact list, or later calculation.

For example, imagine a contact list with an address written as “Portland, Oregon,” a date recorded as 03/04/2026, and a postal code of 02108. A spreadsheet might split the address at the comma, interpret the date according to a regional convention, or remove the postal code’s first zero if it treats the value as a number.

Sorting can make mistakes harder to notice: a misplaced field may still look plausible, and an identifier with a missing zero may still appear numeric. Treat the import as a separate step from sorting, and check the data before using it.

Keep the original file unchanged

A clean source copy gives you something reliable to compare against if the imported values look different.

Save the downloaded CSV without editing it. If you plan to make changes in a spreadsheet, either import it into a new workbook or create a separate working copy. Avoid saving over the original until you have checked the results and know what format you need to deliver.

A CSV is a text file: it stores rows and fields, not all the spreadsheet formatting and data-type choices you might apply after import. Keep that distinction in mind when comparing the original with a spreadsheet view. For a quick check, open the source in a plain-text editor or use the export system’s own preview if available.

If the file contains sensitive personal or business information, use a spreadsheet account and storage location approved for that data. The import checks in this guide do not change who can access a file.

Check the CSV delimiter and column split

The delimiter tells the spreadsheet where one field ends and the next begins.

Many CSV files use commas between fields, but the separator may instead be a semicolon, tab, or another character. If the wrong delimiter is selected, an entire row may appear in one column, or values may spread across columns incorrectly.

Look at the import preview before accepting the file. Check that the headers form separate columns and that familiar values appear under the expected headings. Microsoft’s Excel import options let you choose a delimiter and preview the split. Google Sheets’ import dialog also provides a Separator type choice. The available controls can vary with the app version and import method.

A comma inside a quoted field should not be treated like a field boundary. For example, a properly quoted address such as “Portland, Oregon” should remain together in one field even when commas separate other fields. If the preview splits that address, inspect the delimiter and the quoting in the source rather than trying to repair the rows by sorting.

If you are unsure which separator the file uses, inspect one or two raw lines in a text editor. Compare the characters between values with the import preview. Do not select a delimiter just because it is the most familiar.

Confirm what each date means

A date can look valid while representing a different day than the source intended.

The value 03/04/2026 is ambiguous: it could mean March 4 or 3 April, depending on the date convention used by the source. Do not infer the convention from the spreadsheet’s display alone. Check the exporting system’s settings, documentation, or a record whose date you can confirm independently.

When the convention is known, choose import or conversion settings that match it. In Power Query, Microsoft documents that locale affects how text values, including dates, are interpreted during conversion. Google Sheets’ spreadsheet locale affects default date and number formatting; changing it affects the spreadsheet, so check the scope before changing a shared file’s setting.

After conversion, compare a few dates with known records. Also check whether the values behave like dates when sorted. A date stored as text may sort by its characters rather than in calendar order; a correctly interpreted date should sort chronologically. If the source convention remains uncertain, keep the original date text and ask the data provider rather than guessing.

Preserve leading zeros and other identifiers

Values used to identify something are often best handled as text, even when they contain only digits.

Postal codes, account numbers, product codes, and employee IDs are labels, not amounts to calculate. If a postal code is 02108, converting it to a number can remove the leading zero. Microsoft specifically documents this kind of automatic conversion when importing CSV data and describes ways to preserve such values as text.

Set the relevant column to text during import when the available options allow it. In Excel, use the import preview or the appropriate text-import controls for your version; the menus and automatic conversions can differ by platform and method. The Text Import Wizard is one documented route in supported Excel versions. In Google Sheets, review the import settings and then check the resulting values; if needed, format the identifier column as plain text before entering or converting values.

Formatting a damaged value as text afterward does not necessarily restore digits that were already removed. If 02108 has become 2108, go back to the untouched source or reimport the column using a text setting. Check the first and last digits of several identifiers, not just one.

Check decimal and thousands separators

Number conventions can change how a value is read, especially when a file comes from a different regional setting.

A number such as 1,234.56 may use a comma for grouping thousands and a period for decimals. In another convention, punctuation may be used differently. If an imported amount looks unexpectedly small, large, or split into pieces, check the source’s number convention and the locale used for conversion before doing calculations.

Locale settings can affect how text values are interpreted, not merely how they are displayed. Microsoft’s Power Query guidance describes locale as relevant to converting text to data types, while Google Sheets documents that spreadsheet locale affects default date and number formatting. Avoid changing a shared spreadsheet’s locale as a quick fix without checking how the change may affect other values and collaborators.

If the file is for reference rather than calculation, retaining a value as text may be safer than converting it under uncertain assumptions. If calculations are required, confirm the convention with the exporting system and test a few known amounts.

Use a short verification pass before sorting

A focused comparison is more useful than assuming the import preview caught every issue.

An import preview helps you see how data may be divided, but it does not prove that every value was interpreted correctly. Before sorting or sharing the file, compare representative rows with the original, including a row with a quoted comma, a date, an identifier with leading zeros, and any number that uses punctuation.

  1. Import the CSV into a new sheet or workbook, leaving the source file untouched.
  2. Confirm the delimiter and check that headers and sample fields appear in the intended columns.
  3. Verify the source’s date convention, then check several imported dates against known records.
  4. Keep identifier columns as text where leading zeros or exact digit sequences matter.
  5. Check sample amounts against the source, including decimal and thousands separators.
  6. Sort a copy of the checked data, then verify that the rows still keep related fields together.

Troubleshoot the symptom, then choose the next step

Start with the kind of change you can see, and trace it back to the relevant import setting or source value.

If something looks wrong after import, pause before editing cells one by one. Use the symptom to narrow down what to check first. The table is a diagnostic starting point, not a guarantee that a single setting explains every issue.

First checks for common CSV import problems
What you seeCheck firstPractical next step
The whole row appears in one columnThe selected separatorReopen the import settings and choose the delimiter used by the source.
An address or name splits across columnsQuotes around text containing a delimiterInspect the raw source and preview; confirm the quoted value stays in one field.
A date appears reversed or sorts unexpectedlyThe source’s date convention and import localeVerify against a known record; reimport or convert only when the convention is clear.
A postal code or ID has lost its first zeroAutomatic number conversionReimport the column as text from the untouched source.
An amount has an unexpected valueDecimal and thousands separatorsCompare with the exporting system and check the locale used during conversion.

Importing in Excel or Google Sheets

Use the import workflow’s preview and data-type controls, while allowing for interface differences.

In Excel, a common route is to use the Data tab’s text or CSV import option, often labeled From Text/CSV, and inspect the preview before loading the data. Depending on your Excel version and platform, you may see choices for delimiter, data detection, or transformations. Some versions also support the Text Import Wizard. If the interface differs, look for the import preview and controls for delimiter and column type rather than following a menu name that may not match your screen.

In Google Sheets, use the file import flow and review the Separator type setting in the import dialog. After importing, inspect dates, numeric values, and identifier columns before sorting. If you consider changing the spreadsheet locale, remember that it affects default date and number formatting for the spreadsheet, not just one imported column.

In either app, settings and behavior may change with version, platform, and import method. The safest routine is consistent: preview the split, verify the interpretation of sensitive columns, compare samples with the original, and sort only after those checks.

Frequently asked questions

Why does my CSV open in one column?

The spreadsheet may be using a delimiter that does not match the file. Reopen the import options, check the preview, and choose the separator used by the source, such as a comma, semicolon, or tab.

How can I stop Excel from removing leading zeros from a CSV?

Import the relevant column as text using the options available in your Excel version. If zeros have already disappeared, reimport from the untouched original; changing the damaged cell’s format afterward may not restore them.

How do I know whether 03/04/2026 means March 4 or 3 April?

The value alone does not establish its meaning. Confirm the date convention with the exporting system or a known record before converting or sorting it.

Should postal codes and account IDs be numbers or text?

If the digits identify a place, person, product, or account rather than representing a quantity, text is usually the safer type. This helps preserve leading zeros and exact digit sequences.

Does an import preview catch every CSV problem?

No. A preview can show how fields split, but it cannot confirm every date, identifier, or number was interpreted as intended. Compare several representative rows with an untouched copy of the source.

Sources & further reading

Explore the original sources behind this article. Our editorial perspective is separate from the organizations we reference.

  1. [S1] Import or export text (.txt or .csv) files | Microsoft Supportsupport.microsoft.com
  2. [S2] Learn how to optimize your data ingestion - Google Docs Editors Helpsupport.google.com
  3. [S3] Data Types in Power Query - Power Query | Microsoft Learnlearn.microsoft.com
  4. [S4] Text Import Wizard | Microsoft Supportsupport.microsoft.com
  5. [S5] Set a spreadsheet’s location & calculation settings - Computer - Google Docs Editors Helpsupport.google.com
BEULOG

Your next article starts with an idea.

Bring your brand’s perspective to a workspace built for researching, writing and publishing.

Create your workspace