Import CSV and Excel data: delimiters, decimals and dates

Updated

Importing brings data from a file into the worksheet: a CSV or text file exported from a measuring machine, a data logger or a spreadsheet, or an Excel workbook. The hard part is not reading the file but reading it correctly: which character separates the columns, whether 1,252 means one and a quarter or one thousand two hundred, and whether 09/11/2026 is in September or November. StatLab works these out from the file and shows you a preview before anything changes.

When to use it

  • A coordinate measuring machine, gage or tester writes its results to a CSV or TXT file.
  • A supplier or another plant sends data in Excel, or in a CSV saved by Excel in another language.
  • You keep historical data in a workbook and want one sheet of it in StatLab.
  • You want to add new columns next to data you already have, such as a second day of readings.

For a few values, copying cells in a spreadsheet and pasting them into the worksheet is quicker. Import is better for whole files and for files from other regions.

How to do it in StatLab

  1. Choose File › Import data… and pick the file, or drag the file from your computer and drop it on the worksheet.
  2. StatLab reads CSV and text files (.csv, .tsv, .txt, .tab, .dat) and Excel workbooks (.xlsx, .xlsm). Old .xls files cannot be read: save them as .xlsx in Excel first.
  3. The import dialog shows the first 10 rows, typed the way the worksheet will show them, and the size of the data (for example 6 rows × 3 columns). Check these settings; change any that look wrong and the preview follows:
    • Delimiter: comma, semicolon, tab or vertical bar.
    • Decimal separator: point (1.5) or comma (1,5).
    • Dates: day/month/year, month/day/year or year-month-day.
    • First row has column names.
    • Sheet, for a workbook with several sheets.
    • Put the data, when the worksheet already has data: Replace the worksheet or Add after the current columns.
  4. Press Import. Results records the file name and the number of columns and rows. Ctrl+Z undoes the import.

How the settings are worked out:

  • Delimiter: the character that splits every line into the same number of cells, and whose cells read as numbers or dates.
  • Decimal separator: the one that most numbers can only be read with. 1,26 can only be a decimal comma; 1,252 could be either, so it does not count. When nothing in the file settles it, StatLab uses your browser's region.
  • Date order: dates with a first number above 12 (13/11/2026) must be day-first, and dates with a second number above 12 must be month-first. When no date settles it, StatLab uses your browser's region.
  • Text encoding: files saved by Excel as CSV (Windows-1252), CSV UTF-8 or Unicode Text are all read with their accents.

Delimiter, decimal separator and dates apply to text files only. Excel files store real numbers and dates, and cells stored as text in Excel stay text, so a lot number 0012 keeps its zeros.

Example

A supplier in Spain sends thickness-nov.csv, saved by a Spanish-language Excel. Opened in a text editor, it reads:

Date;Lot;Thickness (mm)
09/11/2026;A-117;1,252
10/11/2026;A-117;1,248
11/11/2026;A-118;
12/11/2026;A-118;1,261
13/11/2026;A-119;1,239
16/11/2026;A-119;1,26

Your browser is set to English (United States), which writes 1.5 and month/day/year. You drop the file on the worksheet, and the dialog proposes:

SettingDetectedWhy
DelimiterSemicolonEvery line splits into 3 cells at the semicolons
Decimal separatorComma (1,5)1,26 can only be read with a decimal comma
DatesDay/month/year13/11/2026 and 16/11/2026 cannot be month-first
First row has column namesCheckedThe first row is text above numbers and dates

The preview shows 6 rows × 3 columns: the blank line at the end is ignored. After Import, Results says Imported thickness-nov.csv: 3 columns, 6 rows, and the worksheet holds:

C1-D DateC2-T LotC3 Thickness (mm)
2026-11-09A-1171.252
2026-11-10A-1171.248
2026-11-11A-118*
2026-11-12A-1181.261
2026-11-13A-1191.239
2026-11-16A-1191.26

(Dates are written here as year-month-day; the worksheet shows them in your region's order.) The empty thickness on 11 November became a missing value (*), not a zero.

Had you forced the wrong settings (decimal point and month/day/year), the preview would have warned you: thickness would read 1252, 1248 and so on, and the date column would turn into text, because 13/11/2026 is not a valid month-first date.

How to read the results

  • Check the column labels. C1-D is a date column, C2-T a text column, and a plain C3 a numeric column. A column of measurements labelled -T means some cell could not be read as a number.
  • Check the size. Compare the row count with what you expect from the source. A count that is too low can mean the wrong delimiter merged columns or the wrong sheet was chosen.
  • Check one value you know. Compare the first thickness with the file: 1.252 mm, not 1252.
  • Check missing values. Blank cells in the file become missing values. Make sure they are really missing and not a code such as - or n/a, which would turn the column into text.

Common mistakes

  • Not checking the decimal separator when every number has three decimals. If a file only contains values like 1,252, nothing in it proves whether the comma is a decimal or a thousands separator, and StatLab follows your browser's region. Look at the preview and set Decimal separator yourself.
  • Dates where every day is 12 or below. In a file from 1 to 12 November, every date could be read either way. StatLab follows your region; check a date you know.
  • Leading zeros in CSV files. CSV has no way to mark a cell as text, so a column of 0012, 0013 comes in as numbers. Import an Excel file to keep the zeros.
  • Text markers in numeric columns. Values such as <0.5 or OOT turn the whole column into text. Fix them, then use Change data type to turn the column back into numbers.
  • Replacing when you meant to add. If the worksheet already has data, choose Add after the current columns to keep it. Undo brings back a replaced worksheet.

Frequently asked questions

Can I import old .xls files?

No. Open the file in Excel, choose Save as › Excel Workbook (.xlsx), and import that file.

How do I import one sheet from a workbook with several sheets?

Choose it under Sheet in the import dialog. To bring in a second sheet, import the file again and choose Add after the current columns.

What happens to duplicate column names?

If an imported name is already in use, StatLab adds a number, such as Lot_2, because every column name must be unique.

Is my file uploaded anywhere?

No. The file is read inside your browser and never leaves your computer.

Why did TRUE and FALSE come in as text?

Excel's TRUE/FALSE cells are imported as the text TRUE and FALSE. If you need numbers, use Recode values with the rules TRUE → 1 and FALSE → 0.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab