Flat File

Converts an XML document to a flat file or a flat file to an XML document. Supports fixed width and delimited flat files.

Revision History

10.0.0.11 Added Action CreateRetainEmptyColumns which does not strip away the empty columns at the end of a row.

Properties

Action

Type: List Input
Specifies whether to convert an XML document to a flat file (Create) or a flat file to an XML document (Parse).

Parse
Create

FileType

Type: List Input
Indicates the type of flat file to be read or emitted.

Delimited
FixedWidth

RowDelimiter

Type: String Input
Provides one or more characters that will be used to delimit rows in the flat file. See Escaped Characters (under Remarks) for more information.

ColumnDelimiter

Type: String Input
Provides one or more characters that will be used to delimit columns in a column-delimited flat file. Has no effect on fixed-width flat files. See Escaped Characters (under Remarks) for more information.

Encapsulator

Type: String Input
Provides a string that will be used to encapsulate values (cells) in the flat file. See Escaped Characters (under Remarks) for more information.

HasColumnNames

Type: Boolean Input
When true, indicates that the first row of the flat file contains column names.

ColumnNames

Type: Multiline Text Input
Provides a list of column names to be mapped when Action is Parse in order to product more readable XML. For Action Create, provides a list of column names to be used on row 1 if HasColumnNames is True. List each column on a separate row. For fixed-width flat files, use the notation columnName=width****to provide a padding width.

FlatFileDocument

Type: Multiline Text InputOutput
Provides access to the flat file document being parsed or emitted.

XmlDocument

Type: Multiline Text InputOutput
Provides access to the XML document being parsed or emitted.

Remarks

Flat File is a flexible Connector that can both parse and generate flat files. Flat files may be either fixed-width or delimited. For fixed-width files, ColumnNames may contain a list of column names in the form columnName=width. In all other cases, columns should be listed one per row in this Property.

Escaped Characters

The RowDelimiter, ColumnDelimiter and Encapsulator properties allow the following escaped characters to be provided:

  • \\ Backslash
  • \0 ASCII character 0
  • \a Alert
  • \b Backspace
  • \f Form feed
  • \n New line. Line break in Linux. In Windows, a line break is typically \r\n
  • \r Carriage return. In Windows, a line break is typically \r\n
  • \t Tab
  • \v Vertical tab

Examples

See Sample Workflow for an example of creating and parsing a flat file.