Creating a multiple fixed width record data format
To create a new data format for multiple fixed width records:
- Open Format Designer.
- Click Create new data format.
-
Complete this general information:
- Format Type
- Select Multi Fixed Width Records.
- Name
- Specify a unique name for the new data format.
- Description
- Optionally, specify a description for the new data format.
- Click the TML Details tab.
-
Complete this information about separators:
- Initial lines to ignore
- The number of lines to ignore at the start of the external file. The default is 0.
- Record Separator
- The type of separator used at the end of each record in the
external file. Select from:
- Windows New Line
- Unix New Line
- Other
Specify a parameter as the record separator, for example, \t for tab.
The default separator is Windows New Line. It is displayed in the script as record-sep="\r\n". That is, carriage return and new line.
-
Specify the records included in the format:
- Click the Upload a File browse button to import existing field names from an example file. The field names are extracted and inserted into the rows, replacing any field names you have already defined.
- Click Add to add a new record.
-
Complete this information to add a new field:
- Prefix
- The string that identifies the start of each record.
- Record Name
- The name that identifies each record.
- Click OK. The new record is added to the format.
-
Complete this information about the record:
- Click Add to add a
new field.
Note: The start position is automatically generated. It is calculated as Start + Length from the previous record.
- Specify the length of the field, that is, the number of characters reserved for that field.
- Specify the name of the field.
Note: These must conform to XML syntax. For example, field names must not start with numeric characters. Field names must also be unique within the field set.
- After creating a new record, the record name appears as a tab for you to select. Using the tabs, you can move between records to select and edit them.
- Click Add to add a
new field.
- Select Ignore to remove this field from the output.
- Click Insert to add a new field inbetween two existing fields.
- Click the up and down arrows to change field positions. Or, you can click and drag a field to the desired position.
- Click Delete to delete a field.
- Click on a record tab and click Edit Record to change details about the record. For example, to change the prefix character.
- Click Delete Record to delete a record.
-
Optionally, click the Script tab to
create or edit a format in text view.
Note: The script must form valid XML.
- Click Save Format.
Parent topic: Transformations in Transformation language (TML)