Fileout Output Object

The Integrator Fileout output object saves data to a file. The selected columns are written out to a variable delimited file suitable for input to Builder. The user can specify the delimiter character. The default delimiter is a tab ("\t").

The Fileout output object can also write out a dictionary file (dic or dict extension) suitable for input to Builder or back into Integrator. For output objects, the output_type attribute defaults to "fileout".

Fileout Attributes

Attribute Type Description
output_type
(required)
String Identifies the object as a Fileout output object. The value of the string is "fileout".
input
(required)
String Defines the object from which the data flow is arriving.
filename
(required)
String Defines the filename (and path) for the output. The file will be created if it does not exist. It will overwrite the file if it does exist. See the append attribute. If a file extension is not specified, .txt is the default. The default directory will be the location of the Integrator script.
safe_write Boolean

Indicates, if "true", that the output is written to a copy of the file which is then moved into place if the task succeeds. The file output is collected in a new file which is the name of the filename followed by the "#" character, and then moved to the requested filename at the end of the task. This may require more disk space (since the old file and new file may exist at the same time), but the file will always hold the results of a successful run. append and safe_write are contradictory; do not use append if using safe_write.

TIP: Use of this attribute avoids issues that arise when the same file is read and written in the same task.

append Boolean Indicates, if "true", that information will be appended to the end of an existing file instead of overwriting it. Some care should be taken to ensure that the columns of the appended data match the columns that already exist in the file. safe_write and append are contradictory; do not use safe_write if using append.
columns Array of Strings Defines the columns that should be written to the file and their order. If not specified, all columns are written out. The attributes columns and remove_columns are mutually exclusive.
remove_columns Array of Strings Allows columns to be excluded from the Fileout object. Each string names a column that should not be included in the output, allowing Integrator to output a subset of the columns without having to list all the desired output columns. Do not use the remove_columns attribute if you are using the columns attribute.
delimiter String Defines the single-character to be used as the delimiter in the output file. If not specified explicitly, the default character is an ASCII tab. Non-standard characters can be entered as escape sequence characters in strings using the octal (base 8) value of the character as shown in the fourth example below.
  • delimiter = "\t"
  • delimiter = ","
  • delimiter = "|"
  • delimiter = ‘\376’
newline String

Specifies a newline character for text output. The specified character will be used to end each output line of regular output. This attribute should not be used for XML output. If this attribute is not specified or empty, the file output object will use the default linefeed for each platform—LF (ASCII 10) for Unix systems, and CR LF (ASCII 13 10) for Windows systems. The following special values are accepted for this attribute:

  • crlf—The newline will be CR LF (ASCII 13 10)

  • lf—The newline will be LF (ASCII 10)

  • cr—The newline will be CR (ASCII 13)

NOTEAvailable starting with 7.0(56).

file_type
(required)
String Determines the file type of the output file. This required attribute can have a value of one of the following:
  • column_headers—Writes a delimited output file with the first line being a list of column names.
  • standard—Writes the delimited output file without column names.
  • xml—Writes a basic Extensible Markup Language (XML) file, similar in format to those created by Microsoft Access. The top-level element is "dataroot", containing a set of row elements named "row". Each row element contains a set of column elements, each element named with the name of the corresponding Integrator column.
  • Excel—Writes out an Excel xls file. The filename must end with the extension xls. The first row of the spreadsheet will contain the column names, and subsequent rows will contain the values. Cell formatting is performed for dates, percentages and currencies. You can use an external tool to convert to xlsx format if required.

dictfile1 String Defines a dictionary file for output. The dictionary is written in the original DI dictionary format, which defines column types as well as column names.
dictfile2 String Defines a new-style dictionary file for output. These can contain field names which contain special characters (like parentheses). This dictionary style is more compatible with newer Builders across platforms.
dicttypes1 Array of Strings Defines the types of the columns for the dictionary defined in dictfile1. A string can be either Key, Data, or Info[keyname]. This attribute allows a complete version 1 dictionary that can be immediately used in Builder, without any modifications. If dicttypes1 is not defined, all columns in the dictionary are identified as Key.
always_quote Boolean Controls whether or not quotes are added to column headers and output values. If "true", all column headers and output values are quoted and any existing quotes in the data are doubled. If "false" or not used, all column headers are quoted only if they begin with a quote or contain an output delimiter (a space or comma). This attribute is not used by default.
never_quote Boolean Disables any quoting added to output values. Optional. If "true", no attribute values are quoted, even if they contain delimiters or double-quote characters. This attribute is used for fine-grain control of quoting behavior in unusual circumstances. The always_quote and never_quote attributes cannot be used simultaneously.
encoding String Defines the encoding used to write the output file. Optional. Values include:
  • auto—The file will be written as UTF-8 if any of the other objects in the same task processes Unicode characters; otherwise, the file will be written using Latin1 characters. (default)
  • ascii—The file will be written as ISO-8859-1 or Latin1 characters.
  • latin1—The file will be written as ISO-8859-1 or Latin1 characters.
  • utf-8—The file will be written as UTF-8 Unicode characters.
  • unicode—The file will be written as 2-byte Unicode characters (UCS-2) with native byte swapping, unless overridden by a UCS-2 file signature.
  • unicode-be—The file will be written as being UCS-2 characters in big-endian fashion.
  • unicode-le—The file will be written as being UCS-2 characters in little-endian fashion.
  • gb18030—The file will be interpreted as Chinese National Standard 18030-2000 characters. The gb18030 encoding option is only supported on Windows platforms.

If a signature is requested (see the signature attribute), the appropriate Byte Order Mark (BOM) will be written to the file.

If the encoding attribute is auto and no signature is found, the encoding is assumed to be latin1 if no other object in the task handles Unicode data and the Integrator file is not encoded as utf-8 (using the charset 1208 directive). Otherwise, the encoding is assumed to be utf-8. Any dictionary written by the Fileout object will match the Latin or Unicode status of the output file. See Integrator Unicode Data Support.

signature String Defines whether a Byte Order Mark (BOM) is written for Unicode files. Values include:
  • auto—A signature is only written for files encoded in UCS-2 characters; no signature is written to UTF-8 files. (Unix and Windows only) (default)
  • true—A signature is always written to a Unicode file.
  • false—A signature is never written to a Unicode file.
create_directory Boolean Determines whether Integrator creates parent directories needed for the output file. A value of "true" indicates a parent directory is created; "false" indicates it is not created. The default is "false".
trace_before Sub-object Traces data flows entering the specified object. This is equivalent to adding the Trace process object immediately before the current output object. See Embedded Trace Object.