Contact

Gnumeric · Importing data · Beginner

Import CSV and Fixed-Width Text in Gnumeric

Import semicolon CSV or fixed-width text in Gnumeric. Set column boundaries, decimal locale and text types, then check numbers and leading-zero codes.

CSV import verified in Gnumeric 1.12.57; fixed-width extension source-reviewed in 1.12.62, not runtime-tested · Editorial standards

Use Gnumeric’s configurable text import for semicolon CSV or fixed-width records. The CSV exercise below separates fields with a semicolon and interprets decimal commas through the import locale. The fixed-width exercise uses character positions instead of delimiters. In both cases, correct column splitting does not establish that amounts became numbers.

Requirements and sample

The semicolon CSV import below was tested on 2026-10-16 in Gnumeric 1.12.57, on Debian 13.6 Linux with an English interface and C worksheet locale. The test used Germany (de_DE) as the import source locale. The 1.12 manual and 1.12.62 source were also reviewed, but 1.12.62 was not the tested application version. Other versions, translations and data conventions can differ.

Download the synthetic CSV. It is UTF-8 text, with this content:

Item;Amount;Code
Café;12,50;00123
Paper;7,25;00456
Ink;10,25;00789

The intended result is three columns, three numeric amounts totaling 30, and three five-character codes. The CSV itself stores no spreadsheet cell types.

Import without losing the codes

  1. Start with an empty workbook. Choose Data → Import Data → Import Text File, then select the downloaded CSV. This opened Text Import Configuration in the tested 1.12.57 build. The manual also describes a configurable File → Open route, but that file-type choice was not exposed in this test; use the Data import route here.
  2. In the first panel of the Text Import druid, choose the file’s UTF-8 encoding, include the heading and all three records, and use separated fields rather than fixed-width columns. Check that Café is readable.
  3. In the separator panel, enable semicolon as the field separator. Do not enable comma for this file: those commas belong inside the Amount values. The preview must show Item, Amount and Code as three columns, not split amounts.
  4. In the final panel, set Source Locale to Germany (de_DE), found under Western Europe in the tested build. Leave Amount in General so this locale interprets its decimal commas. Locale affects interpretation of incoming numerical text; changing a cell’s display format after a bad import does not repair the original parsing.
  5. Set the Code column’s import format to Text before finishing. Use the final-panel column format controls; the source implements a format selector for the selected column. The Item column can remain General for these text labels. Include all three columns.
  6. Click Finish. With the heading in row 1, check the values in B2:B4 and codes in C2:C4. Save a working copy as a Gnumeric workbook so spreadsheet types and later formulas are retained.

Verify values, not just appearance

In unused cells enter:

=COUNT(B2:B4)
=SUM(B2:B4)
=LEN(C2)

Expected results are 3, 30, and 5. C2 should contain 00123, not 123. COUNT is important because a total can look plausible while silently excluding a text amount. These independently calculated checks also passed in the native Gnumeric 1.12.57 run: COUNT returned 3, SUM returned 30, and LEN returned 5.

If the first amount is displayed as 12.50 rather than 12,50 after import, that can simply reflect the worksheet’s display locale. Verify its numerical value before changing appearance.

Native settings and result

These screenshots show the semicolon CSV exercise only, not fixed-width import.

Select a screenshot to open the full-size image.

Gnumeric 1.12.57 import configuration with Germany source locale and Code column set to Text

Actual Gnumeric 1.12.57 capture, 2026-10-16: Germany (de_DE), Amount General and Code Text before import.

Gnumeric 1.12.57 imported values with leading-zero codes and COUNT SUM LEN results

Actual imported sheet: the three checks returned 3, 30 and 5, and the original codes retained their zeros.

You can inspect the saved native practice workbook. Saving the workbook was verified; closing and reopening it was not part of this test. The troubleshooting cases below are guidance rather than additional executed variants.

Troubleshooting and safe recovery

  • One long column: return to import and select semicolon.
  • Amounts split into two columns: remove comma from the separators.
  • COUNT is below 3: re-import with the correct numeric locale. Do not merely apply a Number format to text and assume it became numeric.
  • Codes lost zeros: start again from the original CSV, setting Code to Text. Padding a damaged identifier after conversion is not a safe general repair, especially for long identifiers.
  • Accented characters are garbled: correct the encoding before finishing.
  • Mixed decimal conventions: ask the exporter for one consistent convention or import the ambiguous column as text for deliberate cleanup. Do not globally replace commas when they may have other meanings.

Keep the untouched CSV so the import can be reproduced. For the verification formulas, see COUNT, SUM and LEN.

Import fixed-width text with known column boundaries

Fixed-width text assigns each field a set character range. Spaces may be padding or part of a label, so treating every space as a separator would split Paper clips into two fields.

This section was checked against the official Gnumeric 1.12.62 source and packaged manual, using the English desktop GTK interface labels. The new fixed-width exercise was not run in Gnumeric, and has no new application screenshot or saved native workbook. Its file layout and numerical expectations were checked independently. It does not establish behavior on Windows, macOS or another Gnumeric release.

Download the fixed-width sample

Download the fixed-width order records. This original synthetic file is ASCII text, valid UTF-8, with four lines of 32 characters each, excluding the LF line endings. It contains spaces, not tabs; keep the downloaded spacing intact. Line 1 is the heading, followed by three records.

The layout is defined as follows. Positions count from 1 at the first character of each line.

Imported column Character positions Field width Import format
A: Code 1–6 6 Text
B: Item 7–20 14 Text
C: Qty 21–24 4 General
D: Price 25–32 8 General

Create three boundaries after characters 6, 20 and 24, leaving the rest of the line as Price. The | marks below illustrate those boundaries; they are not present in the download:

Code  |Item          | Qty|   Price
00123 |Paper clips   |   2|    3.50
00456 |Blue pen      |   5|    1.20
00789 |Desk pad      |   1|   12.00

Define and repair the boundaries

  1. Start with a fresh practice workbook. Choose Data → Import Data → Import Text File and open the TXT download. This route is present in the reviewed 1.12.62 source; the earlier runtime test on this page covered CSV only.
  2. In Text Import Configuration, select UTF-8, include lines 1 through 4, and choose Fixed width, not separated fields. Ensure Unix (LF) line breaks are enabled for this file. Continue to the fixed-width panel.
  3. Check the preview before trusting any guessed boundaries. Auto Column Discovery can provide a starting point, but it is not proof of the layout. To build this small example from scratch, click Clear first. This removes the current boundary definitions, not the source file; it is a reset, not Undo.
  4. In the preview, double-click with the primary mouse button where the next field should start. Split before character 7, then before character 21, then before character 25 in the original line. That gives widths 6, 14, 4 and 8, not four equal-width columns. Inspect the heading and every record against the boundary illustration above.
  5. To repair a misplaced split, open the preview column’s right-click context menu. Widen this column moves that column’s right boundary one character to the right; Narrow this column moves it one character to the left. These commands adjust the shared boundary with the next column, rather than shifting the entire remaining layout. They apply where another column exists and the neighboring widths allow the change. Use Merge with column on left or Merge with column on right to remove an unwanted boundary; double-click again to add a missing one. Do not use a split inside Paper clips or Blue pen.
  6. Continue to the final panel. Set Trim: Both sides to remove this file’s padding at field edges while retaining spaces inside Item labels. This is appropriate for this fixture, not a general instruction to strip meaningful spaces from every fixed-width file. Set Code and Item to Text, Qty and Price to General, and include all four columns.
  7. This file uses decimal points, unlike the earlier CSV. Set Source Locale to one that interprets 3.50, 1.20 and 12.00 as those numbers, such as a US English locale. Do not simply reuse the Germany locale from the CSV exercise. Finish only when all four fields and all four rows match the intended layout.

The released source labels the context-menu commands as shown here. The older manual uses different wording for the merge commands. There is no need to drag a worksheet column border: those borders control display width, not how the text file is parsed.

Verify the imported fixed-width records

With the heading in row 1 and the four fields in A:D, the intended data is:

Code Item Qty Price
00123 Paper clips 2 3.50
00456 Blue pen 5 1.20
00789 Desk pad 1 12.00

In unused cells, check the following. These are independent expected results, not results recorded from a Gnumeric run of this fixture.

Check Formula Expected result
All quantities are numeric =COUNT(C2:C4) 3
All prices are numeric =COUNT(D2:D4) 3
Total quantity =SUM(C2:C4) 8
Total cost, quantity Ă— price =SUMPRODUCT(C2:C4,D2:D4) 25
First code has five characters after trimming =LEN(A2) 5
First code is text, not a formatted number =ISTEXT(A2) TRUE

Use your worksheet locale’s argument separator if it differs from the comma shown in SUMPRODUCT. Check the three codes character-for-character as well: a length check alone cannot prove an identifier is correct. Price may display as 12 rather than 12.00; the cell’s numeric value matters for these checks. The total cost is independently calculated as 2×3.50 + 5×1.20 + 1×12.00 = 25.

If a code loses zeros, a label is split, or COUNT is wrong, re-import the untouched TXT into a fresh practice workbook. Correct boundaries in the fixed-width panel, trimming and types in the final panel, and locale for the decimal convention. Do not repair an unexplained mismatch by deleting characters or changing only the cell’s display format. Save the verified result as a Gnumeric workbook; the TXT source contains no cell types, formulas or formatting.

For another fixed-width export, obtain its field-width specification and verify representative records before importing the full file. The 6/14/4/8 layout is specific to this download, not a universal Gnumeric setting. Tabs, multibyte text and other layouts are outside this exercise.

For the additional checks, see SUMPRODUCT and ISTEXT. To split text that is already in worksheet cells rather than import a file, use Text to Columns.

Official references

  • Gnumeric: Importing Text Files, including fixed-width boundary definitions and the third-panel locale, trimming and column formats. The online manual is not a new runtime test.
  • Gnumeric: Formatting Cells, including text formats and identifiers.
  • Official Gnumeric 1.12.62 source, src/dialogs/dialog-stf-fixed-page.c, src/dialogs/dialog-stf-format-page.c, src/dialogs/dialog-stf.ui, src/stf-parse.c, and doc/C/files-textopen.xml. These pin the fixed-width controls and parser behavior described above.