You are here: Working with Task Components > Text File Tasks > Defining the Structure of a Text File

Defining the Structure of a Text File

Most of the work in configuring a Text File Generator or Reader Task is in defining the structure of the file. To do so, you start from the Root (provided for you) and build a tree structure consisting of different types of nodes:

The text tasks are suited best to parsing line-based text files. The different lines of these text files can vary greatly - for example, one could define a structure in which the fields in one line are delimited by a comma, and the fields in the next line are delimited by a pipe character.

In the MD Link model used for text files, lines may repeat but fields do not. For a certain line in the text data looked like this:

john,patrick,smith

... then one would have to define one field for john, another field (with a different name) for patrick, and a third for smith. There is no way to label any of these fields as optional, though of course they may be blank in the input data, for example:

john,,smith

The MD Link model for text data could be described as fairly rigid. Extra data in general should be avoided. In particular, unexpected extra fields in the text data (appearing at the end of a line) will generate a warning message.