Notes on the text format

Navigation:  Working with other file formats >

Notes on the text format

Previous pageReturn to chapter overviewNext page

As mentioned in the previous section, you can also open and save plain text files (including CSV files) with Calculate:

To open a text file, use the ribbon command File | Open (click directly on the icon itself) to open the file dialog box, simply select the desired file and confirm opening.

To save a document as a text file, choose the ribbon command File | Save as, select Text file in the Save as type list, enter the desired file name and confirm saving.

In both cases, the program displays a dialog box in which you can specify the format of the text file.

The dialog box provides the following options:

Options when saving text files

Note: To be able to make advanced settings via the dialog box for the file format (for example, set separators), select Text file/CSV file with additional options in the list Save as type when saving.

When you save a document as a text file, you can make the following additional settings in the dialog box:

Character set

Here, you can specify which character set to use when the text file is saved.
Note: Calculate suggests a suitable character set automatically. Usually, there is no need to change this setting.

Data format

Here, you can set the format in which the cell contents are to be saved in the text file. The following options are available:
Separators between fields: If you select this option, the cell contents will be separated by a certain character (for example, a semicolon or a tab, see "Separator” below).
Example:
Peter;Miller;24;Main Street
Elizabeth;Jones-Nightingdale;1733;University Drive
Fixed field widths: If you select this option, the cell contents will be distributed over columns with a fixed width. Gaps will be filled with spaces.
Example:
Peter      Miller              24    Main Street
Elizabeth  Jones-Nightingdale  1733  University Drive

Separator

Here, you can specify which character should be used to separate the individual cell contents from each other (for example, semicolons or tabs). Thus, you set the separator here if you have chosen the option "Separators between fields" above.

Note: Of course, the separator must not occur within cell contents, otherwise Calculate would make two entries from a corresponding cell.

Text marker

When saving, Calculate can enclose all cells that contain text within certain characters (for example, quotation marks) if desired.
When opening a text file, you can specify here whether text components in the file are surrounded by such text markers. These characters will then be removed when importing to Calculate.
If you want to do so, select the desired character from the list. Otherwise, select None.
If you select the option Auto (only when saving), a text marker will never be set. unless a line break or a quotation mark already occurs in a cell.Additional quotation marks are then set as a text marker for these cells.

Encoding of newlines

Here, you can select the control characters to insert at the end of each line (to indicate the beginning of a new line).
Note: Calculate suggests suitable control characters automatically. Usually, there is no need to change this setting.
Available options:
CR+LF: This is the recommended setting for Windows.

Options when opening text files

When you open a text file, most of the same options are available as when saving. Use these options as described above to specify the format of the text file you want to open.

There are some additional options when opening files:

Date format

If your text file contains date values, you can decide here whether the components of the date should be positioned differently when importing. If the data in your text file is in the date format DD/MM/YYYY and not in the common MM/DD/YYYY that you might generally use, you can specify this here.
Example:
You always use the date format that is common in the United States, for example, "12/20/2022". In your text file, however, the date values are in the British format "20/12/2022". Thus, select the "TMJ" option to indicate which part of the date is in which position. After the import, the date will then be displayed in Calculate in your region-specific format – i.e. "12/20/2022".
To do so, however, the data type for this column must be set from "Default" to "Date" in the preview window of the dialog box (by clicking on the column header).

Number of header lines

If the first few lines of your text file contain headers (or lines with some explanatory text or similar), enter the number of the lines here. Calculate will then refrain from distributing these lines over several columns like the rest of the data and will store them unchanged in just one cell per line.
The default value is 0 (i.e., no header lines).

Decimal separator/Thousands separator

Here, you can specify which character is used as the decimal separator/thousands separator for numbers in your text file.
Explanation: The decimal separator is the character that is placed in a number with decimal places (for example, the period in 17.50). The thousands separator is the character that can be used to group long digits (for example, the commas in 1,000,000). However, different characters are used for both separators depending on the region.
If  other separators (e.g., 17,50 and 1.000.000) are used in your text file rather than the usual separators in your region, you can specify them here. After the import, the numbers in Calculate will then be displayed with the specific separators of your region (as in the examples above).

Note: Ensure that you do not use the same characters for decimal separator/thousands separator and for the separators mentioned below.

Separators (several can be selected at the same time)

Here, you specify which character is used in your text file to separate the individual cell contents from each other (for example, semicolons or tabs).
In order to facilitate the separation of text in more complex text files, you can select different separators at the same time.

Change data type in the preview window

In the preview window, the data type for each column can be specified by clicking on the column header. Here, you can determine the format in which the cells for the respective column should be displayed in Calculate.
For example, change the data type of a column to text so that numbers with leading zeros (as in telephone area codes or postal codes) are retained.
Or, for numbers surrounded by quotes and therefore interpreted as text, set the desired number format.

Extended number scanning

As described above, you can specify the desired format using the column header in the preview window. If you enable the option "Extended number scanning", for certain number formats that are interpreted as text such manual adjustment is no longer necessary in most cases . Calculate then automatically detects numbers or dates and converts them from text to a suitable number format (right-aligned).
If the option is disabled, certain number formats may be displayed in text format (left-aligned). In this case, you can manually set the desired number formats in the preview window using the column headers.