The Engineering Desk
From the makers of RS-1

DesignSoftware Engineering

How to import CSV quality data without silent errors

Decimal commas, ambiguous dates, lost leading zeros and 9999s: what to check every time data moves between systems.

Most quality data still moves between systems as CSV files exported from CMMs, test stands, ERP systems and spreadsheets. "Comma-separated values" sounds simple, but CSV has no single standard for numbers, dates or text, and small differences cause silent errors. The problems below are worth checking for, whether you write importers or simply use them.

Decimal and thousands separators

In much of Europe, the comma is the decimal separator and the semicolon separates fields: 25,0013;25,0021. Opened with the wrong assumption, 25,0013 becomes 250013, or two separate columns. A good importer detects the delimiter from the file's structure and asks the user to confirm the decimal convention when it's ambiguous.

Dates

Is 03/04/2026 March 4 or April 3? There is no way to tell from one value. Prefer ISO 8601 (2026-03-04) in exports. When reading ambiguous dates, check the whole column: a value with a first field above 12 settles the order.

Text that looks like numbers

  • Part numbers like 00123 lose their leading zeros when treated as numbers.
  • Serial numbers like 1E5 can become 100,000 in scientific notation.
  • Codes such as SEPT2 or MAR1 can be converted to dates by spreadsheets, a problem that famously affected published gene lists.

Keep identifier columns as text, and only convert measurement columns to numbers.

Missing and special values

Instruments write missing data in many ways: an empty field, NA, -, 9999 or ---. Each must be treated as missing, not as zero or as a real value. A single 9999 left in a column of diameters destroys the mean, the standard deviation and every control limit calculated from them.

Encoding and units

  • Use UTF-8 so characters like µ, °, Ø and ± survive. Watch for a byte-order mark at the start of the file.
  • Put units in the header (Diameter_mm) or in a separate row. Never mix inches and millimetres in one column.

A checklist for importers

  1. Show a preview of the parsed table before accepting it.
  2. Report how many values in each column failed to parse, and show them.
  3. Show the min, max and count of each numeric column so outliers like 9999 stand out.
  4. Keep the original file unchanged and record which file each data set came from.

More in Software Engineering