TextFileRead

The TextFileRead function reads the contents of text files.

It can read delimited files, such as CSV files, to return file content field-by-field.

Properties

File path

The path to the file to be read.

Encoding

The encoding type to use when reading from the file.

Options:

  • Default
  • ANSI
  • ASCII
  • EBCDIC
  • Mac
  • OEM
  • Unicode
  • UTF8

The 'Default' option is the encoding used in your operating system.

Return options

The way to read the file and return the content.

Options:

Line by line returns each line contents in a loop. If you have defined fields, each field is returned by the function and can be accessed in the loop.

List of lines returns the entire file, but as a list. Each list member represents one line from the file. If you use a ForEach function to loop the list, you can access all fields separately in the loop.

Complete reads the entire file and returns it as one string.

Fields

Only displayed if Return options is set to 'Line by line'.

This property allows for importing of delimited files.

You can define the fields manually or by importing a sample file.

If you define fields, the function can return each field separately.

Click ... to open the Fields Editor.

FileEditor

Fields Editor

File Format

Select one of:

  • Comma Delimited
  • Tab Delimited
  • Custom Delimited - when selected, add the delimiter in the provided field
  • Fixed length

Text Qualifier

Select one of:

  • "
  • '
  • None

Lines to skip

Header

The number of header lines to ignore in the file.

Footer

The number of footer lines to ignore in the file.

Define Fields

Click LOAD FIELDS FROM FILE to load the fields from a file, which you can then define:
provide the Name, Type and Current Format (for 'DateTime' type) of each field.
If you selected 'Fixed length' as the File format, enter the Length for each field.

Select Skip for fields that you don't want to use.

Review configuration

Click LOAD SAMPLE DATA to load data from a file:

  • Under the Text tab, the original content will display.
  • Under the Formatted tab, the content will display as per the Defined fields configuration.


Code page

Transformations of Unicode Code Points