Ctrl + K
CSV17 min read

Common CSV Import Problems

Understand why CSV imports fail or produce incorrect data and learn practical ways to fix delimiter, encoding, formatting and header problems.

Published: 2026-09-02

CSV files are widely used to exchange tabular data between applications, databases, spreadsheets and automated workflows. Despite their simple appearance, importing a CSV file can fail or produce incorrect results when delimiters, encodings, headers, quoting rules or line endings are interpreted differently by the receiving application.

Common CSV import problems are often caused by assumptions about how the file is structured rather than by the data itself. A file can look correct in a text editor while columns appear merged, characters become corrupted, rows shift unexpectedly or values are interpreted as dates and numbers incorrectly.

Why CSV Imports Fail

CSV is a family of conventions rather than a single rigid format with identical behavior everywhere. Different applications can use different delimiters, character encodings, quoting rules, escape conventions and line endings. An importer must therefore determine how the source file is structured before it can interpret the data correctly.

ProblemTypical Result
Wrong delimiterColumns are merged or split incorrectly
Wrong encodingCharacters appear corrupted
Missing or incorrect headerColumn names or data positions are wrong
Broken quotingRows or fields are parsed incorrectly
Inconsistent column countsSome rows shift or fail validation
Unexpected line endingsRows are not detected correctly
Automatic type conversionValues change during import

Wrong CSV Delimiter

One of the most common CSV import problems is using a delimiter that differs from the one expected by the importing application. Commas are common, but CSV-like files may also use semicolons, tabs, pipes or other characters to separate fields.

name,age,city
Alice,29,London
Bob,34,Paris

If the importer expects semicolons instead of commas, each entire line may be interpreted as a single field. The file itself may not be corrupted; the importer is simply using the wrong parsing configuration.

How to Fix Delimiter Problems

  • Check which character separates fields in the source file.
  • Select the correct delimiter during import when the application provides that option.
  • Use a CSV delimiter detector when the format is unfamiliar.
  • Avoid changing delimiters manually without checking quoted fields.
  • Keep the delimiter consistent throughout the entire file.
💡 If every row appears in one column after import, check the delimiter before changing anything else.

Incorrect Character Encoding

Encoding problems occur when a CSV file is saved using one character encoding but interpreted using another. This is especially noticeable with accented characters, Cyrillic text, Asian scripts and other non-ASCII characters.

name,city
Алексей,Москва
François,Paris
Müller,Berlin

If a UTF-8 file is interpreted using an incompatible encoding, characters may become unreadable sequences. The data can still contain the original bytes, but the importer decodes those bytes incorrectly.

UTF-8 and BOM

UTF-8 is a common choice for modern CSV files, but applications do not always detect it in exactly the same way. Some spreadsheet software also handles UTF-8 files with a byte order mark differently from UTF-8 files without one.

A byte order mark, or BOM, is a special marker at the beginning of a file. It can help some software identify UTF-8 encoding, although UTF-8 does not require a BOM. Whether it should be included depends on the compatibility requirements of the target application.

How to Fix Encoding Problems

  • Determine the actual encoding used by the file.
  • Prefer UTF-8 for new CSV exports unless a target system requires another encoding.
  • Use an encoding detector when the source format is unknown.
  • Re-save the file using the required encoding.
  • Test non-ASCII characters before importing the complete dataset.

Missing or Incorrect Headers

CSV imports can also fail when the importer expects a header row but the file does not contain one, or when the file contains headers that do not match the expected fields. Applications may interpret the first data row as column names or assign generic column names instead.

name,email,age
Alice,alice@example.com,29
Bob,bob@example.com,34

A system expecting columns named name, email and age may reject a file if the headers are misspelled, reordered unexpectedly or replaced with different names. Some importers map columns by position, while others use header names, so the distinction matters.

How to Fix Header Problems

  • Check whether the destination system expects a header row.
  • Verify header spelling and capitalization when the importer is case-sensitive.
  • Ensure every header is unique when required.
  • Place the header row at the beginning of the file.
  • Generate or edit headers to match the destination schema.
⚠️ Never assume that a visually correct header will map correctly. Import systems may depend on exact names, column order or both.

Inconsistent Number of Columns

Every normal CSV record in a rectangular table should contain the expected number of fields. Problems occur when some rows contain too many or too few delimiters, especially when fields contain commas that were not properly quoted.

name,city,age
Alice,London,29
Bob,Paris
Charlie,Berlin,41,Extra

In this example, one row has only two fields while another has four. Depending on the importer, those records may be rejected, padded with empty values, shifted into the wrong columns or silently truncated.

How to Fix Column Count Errors

  • Determine the expected number of columns from the header.
  • Validate every row against that expected count.
  • Look for extra delimiters inside unquoted text.
  • Check for missing values that accidentally removed delimiters.
  • Review malformed rows before importing the complete file.

Commas Inside Fields

A comma inside a field can be mistaken for a column separator unless the field is properly quoted. This is one of the classic reasons a CSV row suddenly contains more columns than expected.

name,address
Alice,"123 Main Street, London"
Bob,"45 High Street, Paris"

The quotation marks tell a CSV parser that the comma belongs to the address field rather than separating two columns. Without the quotes, the address would normally be interpreted as multiple fields.

Quotes Inside Fields

Quotation marks inside an already quoted CSV field also require correct escaping. In the common CSV convention, a quotation mark inside a quoted field is represented by two consecutive quotation marks.

name,note
Alice,"She said ""Hello"" to me."

If quotation marks are not escaped correctly, the parser may consider a field finished too early. This can cause the rest of the row to be interpreted incorrectly and may affect subsequent records.

Newlines Inside Fields

CSV fields can contain line breaks when the field is properly quoted. This is useful for addresses, descriptions, notes and other multiline content, but importers that do not correctly support quoted multiline fields may interpret the embedded newline as the beginning of a new record.

name,description
Alice,"First line
Second line"

A parser must understand that the second line belongs to the same quoted field. If it does not, the row count and column structure can become incorrect.

Different Line Endings

Text files can use different line-ending conventions. Windows traditionally uses CRLF, Unix-like systems commonly use LF, and older Macintosh systems used CR. Modern tools usually handle common formats automatically, but poorly designed importers can still misinterpret line endings.

Line-ending problems may appear as records being combined into one line, unexpected blank rows or invisible control characters appearing in imported values.

How to Fix Line Ending Problems

  • Inspect the file using a text editor that can display line endings.
  • Normalize line endings when the target application requires a specific format.
  • Avoid manually replacing newline characters without accounting for quoted multiline fields.
  • Validate the resulting file after conversion.

Automatic Date Conversion

Spreadsheet applications can automatically interpret CSV values as dates. A value that was intended to remain text may therefore be converted into a date or displayed using a different format. This is particularly problematic for identifiers that resemble dates.

id,value
03-04,Example
2026-08-30,Record

Depending on the application and locale, values such as 03-04 can be interpreted as a date instead of an identifier. Once imported and saved again, the original representation may be difficult to recover.

Leading Zeros Disappear

Another common spreadsheet problem occurs when identifiers such as postal codes, product codes or account numbers begin with zero. Automatic numeric conversion can remove those leading zeros.

postal_code
00125
00480
01001

If the importing application treats these values as numbers, they may become 125, 480 and 1001. The numeric value is mathematically equivalent, but the identifier has changed and may no longer match the original data.

How to Prevent Automatic Type Conversion

  • Import sensitive identifier columns as text when possible.
  • Do not rely on spreadsheet applications to preserve formatting automatically.
  • Use explicit import settings for dates, numbers and text fields.
  • Verify leading zeros and identifier formats after import.
  • Compare important columns against the original CSV before saving changes.

Empty Fields and Blank Rows

Empty fields are valid in many CSV files, but different importers may handle blank values, completely empty rows and rows containing only delimiters differently. For example, a row such as ,, contains three empty fields, while an empty line may represent a completely blank record or simply be ignored.

name,email,age
Alice,,29
,,
Bob,bob@example.com,

Applications may convert empty fields to null values, empty strings or missing values depending on their import model. This distinction can matter when the destination database treats those states differently.

Whitespace Problems

Unexpected spaces around delimiters or values can create subtle import problems. A value such as " Alice" is not necessarily identical to "Alice". Some parsers preserve whitespace while others may trim it automatically.

name,city
 Alice, London
Bob,Paris

Whitespace can affect comparisons, validation, duplicate detection and database lookups. It is therefore useful to decide whether leading and trailing whitespace should be preserved or removed before importing.

Duplicate Headers

CSV files can contain duplicate column names, but many applications expect headers to be unique. When two columns have the same name, an importer may rename one automatically, overwrite one value, reject the file or map data unpredictably.

name,email,email
Alice,alice@example.com,alternate@example.com

If the destination system identifies fields by header name, duplicate names create ambiguity. Renaming columns to unique and meaningful identifiers is usually safer before importing.

Incorrect File Structure

A file may have a .csv extension without actually following a structure that the target importer supports. Reports exported from business systems sometimes contain titles, notes, metadata or summary rows before the actual table begins.

Monthly Sales Report
Generated: August 2026

Product,Quantity,Revenue
Keyboard,25,1250

A strict CSV importer may interpret the first lines as records even though they are not part of the table. Removing non-tabular content or configuring the importer to skip those rows can solve the problem.

BOM and Unexpected First Characters

A UTF-8 BOM can sometimes appear as an unexpected character before the first header when software does not recognize it correctly. Instead of seeing a clean field name such as name, an application may internally receive a value containing an invisible prefix.

This can cause confusing failures when code looks up a column by its exact name. The displayed header may appear correct while comparisons against the expected string fail.

CSV Injection Risks

CSV imports can also create security issues when untrusted values are opened by spreadsheet software. Values beginning with characters such as =, +, - or @ may be interpreted as formulas by some spreadsheet applications.

name,note
Alice,=1+1
Bob,"=HYPERLINK(""https://example.com"",""Open"")"
⚠️ When exporting untrusted user-controlled data to CSV, consider spreadsheet formula injection risks and apply appropriate output encoding or neutralization for the target environment.

Encoding and Delimiter Problems Together

Multiple CSV problems can occur at the same time. A file might use semicolons as delimiters and UTF-8 encoding while the importing application assumes commas and another character encoding. In such cases, fixing only one setting may leave the import partially broken.

When diagnosing a difficult import, verify the file systematically instead of changing several settings at once. Confirm the encoding, delimiter, header structure, quoting rules, row lengths and line endings in that order.

A Practical CSV Troubleshooting Process

  • Open the CSV as plain text and inspect its actual structure.
  • Identify the delimiter used between fields.
  • Determine the character encoding.
  • Check whether the first row contains headers.
  • Count the expected number of columns.
  • Look for commas, quotes or newlines inside fields.
  • Check rows for inconsistent field counts.
  • Inspect dates, numbers and values with leading zeros.
  • Check line endings and unusual invisible characters.
  • Validate the cleaned file before importing it again.

Using a CSV Validator

A CSV validator can quickly identify structural problems before a file reaches the target application. Validation can reveal inconsistent column counts, malformed quoting, invalid records and other issues that are difficult to spot when examining a large file manually.

Validation is especially useful in automated pipelines. Instead of discovering a malformed CSV after database import, a workflow can reject the file early and report the exact type of structural problem that needs correction.

Viewing CSV Data Before Import

A CSV viewer provides a convenient way to inspect how a parser interprets the file. Comparing the rendered columns and rows with the original text can reveal delimiter, quoting or encoding problems before the data is sent to another system.

Editing Problematic CSV Files

When a file contains a small number of formatting problems, a CSV editor can help correct values, remove malformed rows, adjust headers or clean unnecessary data. For large datasets, programmatic processing is generally safer because manual editing can introduce additional inconsistencies.

Common CSV Import Mistakes

  • Assuming every CSV file uses a comma delimiter.
  • Opening an unknown CSV directly in a spreadsheet and saving it without checking type conversions.
  • Ignoring character encoding when importing non-ASCII text.
  • Allowing commas inside fields without proper quoting.
  • Assuming every row has the same number of columns.
  • Treating identifiers with leading zeros as ordinary numbers.
  • Ignoring duplicate or malformed headers.
  • Removing newlines without accounting for multiline quoted fields.
  • Assuming a .csv extension guarantees a valid CSV structure.
  • Failing to validate files before importing them into production systems.

Best Practices for Reliable CSV Imports

  • Define the expected CSV structure before exchanging files.
  • Prefer UTF-8 for new CSV data unless a specific legacy encoding is required.
  • Document the delimiter, quoting rules and header format.
  • Keep the number and order of columns consistent.
  • Quote fields when they contain delimiters, quotes or newlines.
  • Treat identifiers such as postal codes and product codes as text when appropriate.
  • Validate files before processing them.
  • Test imports with representative data before processing large datasets.
  • Preserve the original source file when troubleshooting an import.
  • Use separate validation and transformation steps in automated pipelines.
💡 For reliable CSV workflows, define the file's encoding, delimiter, headers, quoting rules and expected column structure as part of the data contract instead of leaving them implicit.

Frequently Asked Questions

Why does my CSV import into one column?

The importer is often using a different delimiter from the one used by the CSV file. Check whether the file uses commas, semicolons, tabs or another separator and select the matching import setting.

Why are special characters broken after importing CSV?

The file may be interpreted using the wrong character encoding. UTF-8 is a common choice for modern CSV files, but the importer must correctly recognize or be configured to use the encoding used by the file.

Why do CSV columns shift during import?

Columns can shift when rows contain inconsistent field counts or when delimiters, quotation marks or embedded newlines inside fields are not handled correctly.

Why do leading zeros disappear from CSV values?

Spreadsheet applications may automatically interpret values as numbers and remove leading zeros. Import identifier columns as text when their exact representation must be preserved.

Can CSV files contain commas inside values?

Yes. A field containing a comma can normally be enclosed in quotation marks so the comma is interpreted as part of the value rather than as a delimiter.

Can CSV fields contain line breaks?

Yes. Properly quoted CSV fields can contain line breaks, but the importer must support multiline quoted fields or it may interpret the embedded newline as a new record.

Why does my CSV importer reject some rows?

Some rows may contain too many or too few fields, malformed quotes, invalid delimiters or other structural inconsistencies. A CSV validator can help identify problematic records.

Should CSV files use UTF-8?

UTF-8 is generally a good choice for modern CSV files because it supports a wide range of characters. However, compatibility with the receiving application should always be considered.

Why does a CSV header not match the expected field?

The header may contain extra whitespace, an unexpected BOM, different capitalization, a spelling difference or another naming variation. Exact header matching can fail even when the displayed text looks correct.

Can opening a CSV in Excel change the data?

Yes. Spreadsheet software can automatically interpret values as dates, numbers or formulas and may change their representation when the file is opened or saved. Import settings and careful verification can reduce these problems.

Helpful CSV Tools

A CSV Validator checks CSV structure and helps identify malformed records, a CSV Viewer displays parsed rows and columns for easier inspection, a CSV Editor helps modify and clean CSV data, a CSV Encoding Detector helps identify the character encoding used by a file, and a CSV Header Generator helps create consistent header rows for structured datasets.

Conclusion

Most CSV import problems come from differences between the assumptions made by the file producer and the rules used by the importing application. Delimiters, character encoding, headers, quoting, line endings and automatic type conversion can all change how the same file is interpreted. A reliable CSV workflow starts by understanding the actual structure of the source file, validating it before import and explicitly configuring the destination system when necessary. By checking these common problem areas systematically, developers and data users can prevent corrupted characters, shifted columns, lost formatting and failed imports while making CSV-based data exchange much more predictable.

Found an issue?

Found an error, outdated information, or something missing from this article? Let me know through the Contact page.

Your feedback helps improve our articles and keep them accurate and useful.