User Tools

Site Tools


transformations:importtext

This is an old revision of the document!


IMPORT FROM DELIMITED TEXT FILE

(Category: Import | File)

Description

This action loads data from one or multiple delimited text files.

The number of columns in the resulting dataset is defined by the first row of imported data.

Action Settings

Setting Description
Load file Fully-qualified file name of the dataset (includes relative or absolute path).
EncodingASCII, ANSI (with code page), and other types of encoding. If you're not sure what to choose, try UTF-8 as it's the most common Unicode encoding.
SeparatorThe delimiter character that separates one value from another. For instance, for CSV files it should be a comma.
A custom separator consisting of up to 8 characters can also be specified. If No separator is selected, all values are imported into a single field.
DecimalWhen a text value looks like a number, EasyMorph converts it into a number. The decimal character specifies whether such numbers should have comma or dot as decimal separator.
Skip first linesThis option specifies how many lines to skip from the beginning of a file. It can be helpful in case when first rows contain
some metadata (file header) and actual tabular data starts only after that metadata. This setting can be specified using a parameter as well.
Columns don't have headersCheck this if data doesn't have column headers.


Advanced Options

Setting Description
Show parsing errorsCheck this to add a column that contains parsing errors (if any) for each line. It can help detect rows that have too few values, or too many values.
Ignore quotingBy default, values wrapped in double quotes can contain the separator character and line breaks. Check this option if wrapping double quotes should be treated as regular characters.
Maximum number of lines to loadLimits the number of rows loaded from the file. This setting is applied after Skip first lines. Use "0" to load all rows.


Importing Multiple Files

This action can import multiple files. See Importing Multiple Files for more information.

Use cases

Use the Import from delimited text file action when you have a plain text, structured, data file with fields that are separated by a delimiting character. In the case of a file having no embedded delimiters, all values are importing into a single field.

Examples

A pipe-delimited .txt file to be imported starts with 3 rows of metadata and has no header rows.

...
Data to import
---
1|12|3.5|red|265
2|47|4.55|teal|354
3|4|8.1|burgundy|380

Use the following settings:

Separator = "Pipe"
Skip first lines = "3"
Columns don't have headers = [X] (checked)

Output:

1123.5red
2474.55teal
348.1burgundy


See Also

transformations/importtext.1614903621.txt.gz · Last modified: 2021/03/04 19:20 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki