Layout files
Overview
Layout files are ASCII text files containing information about the structure or layout of a flat, CSV, or XML file. The layout file can have any file name and extension.
ANSI encoding is not supported. Layout files containing non-ASCII characters in the field names should be saved with UTF-8 encoding.
The layout file is a delimited text file containing two to five columns. It can have a header line. Each input field in the data file is described on a separate line in the layout file. The field names, sizes, and/or types on each line must be separated by single tab or comma characters. Commas are used in the examples below.
Constructing a layout file
If you have configured a Flat File, CSV, or XML Input tool or an external transform tool within a Data Management project, you can create a layout file from the tool's Properties pane.
Select and then select Layout>Save (text), Save (text with types), or Save (XML).
Layout files should be of one of the following forms:
name, size
name, size, type
name, size, type, format, binary-format (flat files only)
Component | Explanation |
---|---|
name | (Required) Field name. |
size | (Required) Formatted width of field. |
type | Type of field. One of TextVar, TextFixed, Boolean, Int, Decimal, Float, Date, Time, DateTime, or Binary (not case-sensitive). A trailing size or size.scale can follow in parentheses. |
format | (Optional) Format string. |
binary-format | (Optional) Format string used when reading or writing binary data in flat files. |
Example
NAME,SIZE,TYPE,FORMAT,BINFORMAT
Contact,30,TextVar,,
Address,28,TextVar,,
City,28,TextVar,,
State,2,TextVar,,
Zip,5,TextVar,,
Latitude,11,Decimal(10.5) ,,
Longitude,11,Decimal(10.5) ,,
Age,8,Int(4) ,,
Date,10,Date,MM-DD-YYYY,
Time,10,Time,hh:mm:ss