Technical guide

CSV Import Validation Checklist

A CSV can open cleanly in a spreadsheet and still fail an import. The safest place to find out why is a test run, with the same parser, field rules and destination settings you plan to use in production.

4 min read

Start with the file structure

Ask the exporting and receiving teams to agree the delimiter, quote character and header convention. A file called CSV may use commas or semicolons, depending on the export settings. Inspect the file as text, then use a CSV parser configured the same way as the importer. A text editor can reveal the delimiter, but counting commas by eye tells you little when fields contain punctuation.

Compare the field count of each logical record with the header. A stray separator can push an address into the postcode column or create an unexpected field at the end. Check whether the first record contains column names and whether the importer maps by name or position. A correctly named column in the wrong position can still cause trouble with a positional import.

Quoted fields can span lines

In this example, the first name contains a comma and the first note contains a line break and quotation marks. A parser should return two data records, with three fields in each. A script that splits on every newline would count the second line of the note as a separate record.

Example CSV with an embedded line break
id,name,note
00123,"Smith, Jones Ltd","Call Monday
Ask for ""Accounts"""
00124,"Café North",

When investigating errors, establish whether the importer reports physical line numbers or logical record numbers. With multiline fields those numbers diverge, so keeping the source file and a stable record ID makes rejected rows much easier to locate.

Check the encoding before cleaning the data

Agree an encoding that both systems support. UTF-8 is a sensible choice when both ends accept it, but check how the importer handles a byte order mark (BOM). Some importers strip it and others may treat it as part of the first header. Include names with accents, currency symbols and characters outside the basic Latin alphabet in the first test.

If a name such as Café North becomes Café North, check whether UTF-8 was read as a legacy encoding. Go back to the original export and decode it correctly before attempting replacements. Once characters have been lost during a conversion, the altered file may lack enough information to recover them.

Distinguish missing values from duplicate data

The empty final field in the example still occupies the note column. Agree whether a blank field means an empty string, a database null or an instruction to leave the current value alone. Those meanings matter during updates: interpreting every blank as null can clear values that the source never intended to change. Test required fields, whitespace-only values and fields that the source labels with a value such as N/A.

Check headers for duplicates after applying the importer's rules for case and spaces. Then check both identical records and duplicate business keys. Two rows for customer 00123 can have different notes while referring to the same customer. Decide whether to reject both, retain an agreed version or merge selected fields. Confirm whether the key already exists in the destination and whether the import inserts or updates existing records.

Validate types, dates and numbers

Write down each destination field's type, maximum length, required status and permitted values. Treat reference codes such as 00123 as text if the zeros are significant. Check numeric precision and scale before loading amounts, since a destination may round values or reject them. Set a decimal separator explicitly and decide whether grouped numbers such as 1,250.50 are permitted.

Agree an unambiguous date format that the importer accepts, such as 2026-11-12. A value such as 03/04/2026 could represent 3 April or 4 March. For timestamps, agree how offsets are represented and whether the destination stores local time or UTC. Include values around midnight or a daylight-saving change if reporting relies on the local date.

Run a test import and verify the result

Start with CSV Import Doctor for a first pass on column counts, headers, empty rows and identical records. Then select a sample with both ordinary rows and edge cases. Use the real destination schema or a representative test copy and record the import settings so you can repeat the run.

Reconcile the number of logical data records with what was inserted, updated, skipped or rejected, according to how the importer reports those outcomes. Compare a handful of records by key and check that leading zeros, dates and special characters survived. If the import will run regularly, rerun the same sample and confirm it does what you expect when the records already exist.

Before you load the full file

Keep the original export, the agreed field mapping, the test results and a copy of the rejected records. You should be able to explain why each rejected row failed and how it will be corrected or excluded. For repeat imports, keep these checks with the import instructions so the next run can be verified the same way.

Help with your project

If you are combining several exports or need a repeatable import with agreed validation and recovery steps, we can help plan and test it.

Discuss your project