Fixed Format File

Imports data from a specified fixed-width file, typically a text file that does not have a header row.

  1. Configure the File property:
    • If the node does not have an input, use the File property to determine the file to process. You can use either absolute or relative file paths, but note that if the file path is relative, then the temporary directory of the data flow for the current run is used as the base to which the file path is relative.

    Tip: If the files that you want to import have different fields, or if the fields are in a different order, one solution would be to import the files individually and then use the Cat node to combine the individual data sets.

  2. In FileCharacterSet, select the appropriate character set of the data to process, if required.
  3. In the FieldPositions property, specify the field positions within the file, as follows:
    1. Decide what to name the fields.
    2. Count the starting location for the first row of text. When counting, always start at zero.
    3. Count the size of the field by counting until you reach the next row of text, including any blank spaces.
    4. In the FieldPositions property, enter the field position information in the following format:

      <fieldname>,<starting location>,<field size(character length)>,<type>

      Type is optional, and defaults to string if not specified.

      For example: PaymentCode,0,8

    5. Repeat the above steps for each field that you want to identify. Use either of the following formats when listing multiple fields:
      • Use a colon-separated list, for example:

        field1,0,4,int:field2,4,7,string:field3,11,7:field4,18,7:field5,25,7

        - or -

      • Type each new field definition on a new line, for example:

        field1,0,4,int

        field2,4,7,string

        field3,11,7

        field4,18,7

        field5,25,7

  4. In PassThroughFields, optionally specify which input fields will "pass through" the node unchanged.
  5. You can add an additional output to the node. If there are two outputs, the second output is an error output.

Properties

File

Optionally click the folder icon and browse to the file that you want to import.

Note: If you are using the server edition and wish to use a file on your local machine, you must first upload it to the Data360 Analyze server. Please see the topic Uploading data to the server for more details.

Use the From Field variant of this property to look up the value from an input field with the name specified.

FileCharacterSet

Optionally specify the appropriate character set of the data to process.

Select one of the provided character sets, or type the name of a character set, if the one you require is not in the dropdown list.

Choose the (from Field) variant of this property to specify the name of an input field containing the character set.

FieldPositions

Specify the field positions within the file.

Count the starting location for the first row of text. When counting, always start at zero. Count the size of the field by counting until you reach the next row of text, including any blank spaces. Enter the field position information in the following format:

<fieldname>,<starting location>,<field size(character length)>,<type>. Type is optional, and defaults to string if not specified.

To specify multiple fields, use a colon-separated list of field definitions, or specify each field definition on a new line.

For example: field1,10,5,string:field2,15,3

A value is required for this property.

StartLine

Optionally specify the line in the file to start importing.

This is useful if the file contains header lines that should be ignored.

Use the From Field variant of this property to look up the value from an input field with the name specified.

FilenameOutputField

Optionally specify the name of a field to add to the output containing the input filename.

If left blank, no filename field is added to the output.

RecordWidth

Optionally specify the size of each record in bytes.

If unspecified, each record is terminated by a newline.

Use the From Field variant of this property to look up the value from an input field with the name specified.

BlankRowBehavior

Optionally choose what the output should be if there is a blank line encountered during processing. Choose from:

  • Output as Null - Output NULL values where the blank line is present.
  • Skip - Skip the blank line and continue processing.

Use the From Field variant of this property to look up the value from an input field with the name specified.

PassThroughFields

Optionally specify which input fields will "pass through" the node unchanged from the input to the output, assuming that the input exists. The input fields specified will appear on those output records that were produced as a result of the input fields. Choose from:

  • All - Passes through all the input data fields to the output.
  • None - Passes none of the input data fields to the outpu. As such, only the fields created by the node appear on the output.
  • Used - Passes through all the fields that the node used to create the output. Used fields include any input field referenced by a property, be it explicitly (meaning through a 'field1' reference) or through a field pattern such as '1:foo*').
  • Unused - Passes through all the fields that the node did not use to create the output.

The default value is Unused.

If a naming conflict exists between a pass-through field and an explicitly named output field, an error will occur.

Enabled

Optionally specify whether the node is enabled or disabled. You can choose either True or False, or reference another property (see Using derived property values) which will be evaluated to a True or False value.

Disabled nodes are not executed, even if they are selected to run.

The default value is True.

Note: The Enabled property cannot reference any of the Run Properties of a data flow, either directly or indirectly.

LogLevel

Optionally specify the level at which non-fatal messages are logged. The lower the level, the more information will be recorded in the log file. Choose from:

  • 0 - Information
  • 1 - Low
  • 2 - Medium
  • 3 - High

The default value is 2 (Medium), which can be changed in the ls_brain_node.prop configuration file, by modifying the property ls.brain.node.logLevel.

Inputs and outputs

Inputs: 1 optional (filenames).

Outputs: Parsed Data, 1 optional (errors).