Text Definition |
Use this frame to define a text definition that is used when parsing structured text files.
Use this sheet to add one or more fields. Each field specifies one column in the record. Regular expressions are used to define the start and end of the column. The rule has before expression, the field type, and the after expression.
A regular expression that specifies the character(s) before the field data. If the previous field contains an after expression, then this field does not have to contain a before expression. Enter the value or click the + button to select a regular expression token from the popup menu.
Each field has a type. Possible values are:
Value | Description |
---|---|
Text | The item contains the text to be localized. |
Ignore | The item is ignored. |
Context | The item contains the context value that is used to identify this record. |
Comment | The item contains a comment value for the first text column before or after the comment. |
A regular expression that specifies the character(s) after the field data. If the following field contains a before expression, then this field does not have to contain an after expression. Enter the value or click the + button to select a regular expression token from the popup menu.
Let's have an example You have following structure inyour text file:
id1<tab>value1<cr><lf>
id2<tab>value2<cr><lf> ... idN<tab>valueN
The file contains one record in each line. Each record contains two fields: id and value. These fields are separated by a tab character. The record is ended with carriage return + line feed character or file end. Because there are two items to be read, you have to add two rules: one for the id field and one for the value field.
The first rule does not contain either expression, but the second rule contains both. Another possible definition would be:
Here both rules contain after expression but no before expression. Both are equally good and provide the same results.
Specifies other properties.
Header specifies if the file uses a header. Possible values are:
Value | Description |
---|---|
No header | The file has no header |
Fixed amount of lines | The file has a fixed-size header. Enter the size of the header in lines. |
Use rule | The file has a variable-sized header. Enter a regular expression rule that reads the header. |
File extensions contain the file extensions that are mapped to use this format.
Description contains an optional text that describes the definition.