Tablora

Tablora · Library

Separate field boundaries from decimal punctuation

In a semicolon-separated table such as Paper;1.234,50, the comma is a decimal mark. Fix the field boundaries first, then convert the amounts.

Two jobs for punctuation

Spreadsheets set to German, French, Spanish, Turkish and many other languages save CSV files with semicolons between fields, because the comma is already taken as the decimal mark. A line such as Paper;1.234,50 has one field boundary, the semicolon, and two characters inside the amount that belong to the number.

Two separate decisions are needed: which character separates fields, and how the digits in the amount column are written. Mixing them up is how a single amount ends up split across two cells.

Inspecting Paper;1.234,50

The page example is a header item;amount and the record Paper;1.234,50, with semicolon as the Delimiter. The inspector reports 2 rows and 2 columns, and row 2, column 2 reads 1.234,50. The amount is still text at this stage; the inspector does not convert numbers.

If you choose the comma as the Delimiter instead, the header becomes one cell, item;amount, and the record splits into Paper;1.234 and 50. Columns then shows 2, and Rows with a different width shows 1, because the header has only one field. Detect delimiter picks the semicolon for this example because it gives every row the same width.

From structure to numbers

Points of confusion

Original synthetic example

Input
item;amount Paper;1.234,50
Delimiter
;
Expected records
2
Columns in the first record
2
Cell to inspect
Row 2, column 2: 1.234,50

Tools

Sources