Importing Text Files

Gnumeric can import data which is organized as text fields structured in some systematic fashion either from a file or from the clipboard. Importing structured text may require extensive intervention on the part of the user so Gnumeric provides a Text Import druid, which is a three paneled dialog with configuration options. For text imported from files, this druid appears after the file has been opened, using the file format named "Text Import (configurable)" in the File Open dialog, as is explained in Section 9.3 ― Opening Files. For text imported from the clipboard, the druid appears when a user attempts to paste the text into a worksheet, as is explained in Section 5.7.4 ― Cut and Paste Between Gnumeric and Other Applications.

The text import druid contains three panels but the middle panel differs depending on the structuring system used, either with data fields separated by a special character or with data fields occurring at equally spaced intervals in each line. The first panel allows the user to configure the character encoding, line break characters, structuring system, and line range. The second panel allows the user to define the columns by either, for separated data, setting the separating character and text delimiting character, or, for fixed space data, by setting the column spacing. The third panel allows the user to select which columns to import and define their data types.

The steps involved in the text import druid.

  1. Launch the Text Import druid using, in the File, the Open and selecting the "Text import (configurable)" file format type.
  2. Define the character encoding of the text block.
  3. Define the characters indicating the breaks between the lines.
  4. Select the line range from the text block to be imported.
  5. Go to the second panel, which will be different for data structured by separating characters and data structured by fixed spacing.
  6. (For separated data) Define the separating character.
  7. (For separated data) Define the character grouping a text field.
  8. (For fixed width data) Define the field widths.
  9. Go to the third panel.
  10. Configure the inclusion of empty outside columns.
  11. Select the locale that will influence the formatting of the numerical elements in each column.
  12. Select the numerical formats for the data in each columns.
  13. Select the columns to be included in the imported block.
  14. Click on the Finish button.

This explanation of the Text Import druid will first start with a discussion of text files including character encodings and line break delimiters. The explanation will then cover the various strategies used to structure numeric data in text files. Following these discussions, the components of the druid will be presented and, finally, a detailed explanation of each step in the use of the druid will be presented.