Config / Mappings / The TEXT Converter

The TEXT Converter

The text converter can be used to import and export text files. The converter supports fixed-length files, as well as variable files (csv). It is also possible to convert record based data formats such as VDA, which have a field record type at the begin each record.

We assume that you know how to work with mapping lines and how to access the EDI properties.

Using the Assistant

Because text files can have any structure, we cannot detect the format from an example file. The text converter has a limited support to generate the mapping from a description file. To use the assistant, start by creating a mapping and configuring the header properties. Afterwards you can start the assistant and use a CSV file, of the following structure:

Name;Length;Type
Field 1;0;Variable
Field 2;10;Fixed
Example Structure File for Text Mapping Creation

The first column Name is required, as well as the header line. The columns Length and Type are optional. The file is expected to be in the current Windows locale and not Unicode encoded.

Converter Specific Commands

This converter does not support commands.

Import / Export

We will discuss the properties and features for imports and exports separately.

Importing Text Data

After creating the mapping, the first thing you should do is to check whether the header properties are set correctly. Afterwards you can start creating mapping lines, either by using the wizard, like described above, or by adding them manually.

You can use filters inside of write table loops, to create a record only, if the expected data is provided. You can configure if more than one filter is checked in the header properties. You usually use this, for example, to differentiate between different structures based on a record type.

If you need to write data to a table, but do not want to create more than one record, you can use the property Max. Repeat of the loop. In the text converter, setting this property will limit the record count that will be written. The text converter this will not throw an error, if the maximal repeat count is reached.

If you need to create a record and do not have a corresponding field in the file, you can use a trick: Add a fixed-length field of the length 0 as a child of the write table line, to create a record, without relying on actual data from the file. Please be sure to set the value of the property Max. Repeat to one in this case, else the module will try to create an infinite number of records.

Import Header Properties

Direction

Whether you want to import or export data. To import a text file into Microsoft Dynamics NAV 2016, set this to Import.

Encoding

The encoding that should be used. Please note that the encoding are limited

Default

The internal encoding used by Microsoft Dynamics NAV 2016.

Windows-1252

Use the Windows encoding. Depending on the Microsoft Dynamics NAV 2016 installation it can be a different codepage than the Windows-1252. Whenever possible we use the internal encoding of Microsoft Dynamics NAV 2016 with the name “Windows”.

MS Dos

Use a DOS codepage.

IBM-500

Not supported in newer versions of Microsoft Dynamics NAV 2016 using the ServiceTier. A old mainframe encoding. Do not use anymore.

Default Field Type

You can mix fixed-length fields and fields that are separated by one or more control characters in the same mapping. This property specifies the default type, so that you do not have to choose it on every mapping line.

Fixed Length

The field length has to be specified and is a fixed count of characters.

Variable

The field is terminated by one or more control characters.

Default Limiter

You can use this property to specify global default values for the whole mapping. You can override this property on each EDI mapping line. Specifies the control characters that end a variable length field. You can use all special characters.

Default Length

You can use this property to specify a default length for fixed-length fields. You can override this value for each individual fields.

Alternative Delimiter

You can specify an alternative delimiter for variable length fields. Each of the fields in the mapping will accept the alternative delimiter as well as the normal one. This is mainly intended to be used with formats, where the last field in a file is missing the control characters or for formats, where a line break can be used instead of the control characters at the end of a field.

You can use all special characters.

Table Check All Children

This property is new in Anveo EDI Connect 4.00.
In versions prior to version 4.00 this property was only available internally and not always correctly set.

You can define whether the module will accept a loop, when the first filter was successfully check or whether to check for other filters as well. Because the text converter does not execute the complete children mapping line structure, checking more than one filter have to be used with caution.

Import Line Properties

After creating an EDI mapping line, you can configure the properties. We will only show the properties for EDI mapping lines with the Type property set to Data as the other properties behave like in any other mapping.

Field Name

The name is shown in the EDI Mapping Line as the first column. From a technical point of view, this has no effect on the mapping, but we recommend that you set it to the field name according to any documentation that may be available, or use a meaningful name for the field in some other way.

Field Type

You can specify whether the field has a fixed length or is separated by a control character.

Variable

The field is terminated by one or more control characters.

Fixed Length

The field has a fixed length.

Delimiter

This field is only available, if the property Field Type is set to Variable. Specifies the control characters that end a variable length field. You can use all special characters.

Alternative Delimiter

This field is only available, if the property Field Type is set to Variable. Specifies an alternative control characters that end a variable length field. You can use all special characters.

Start Escape

This field is only available, if the property Field Type is set to Variable. Specifies a start escape character. Control characters that would normally end the variable length field are allowed between the Start Escape and End Escape characters.

End Escape

This field is only available, if the property Field Type is set to Variable. Specifies a end escape character. Control characters that would normally end the variable length field are allowed between the Start Escape and End Escape characters.

Length

This field is only available, if the property Field Type is set to Fixed Length. Specifies the count of characters that should be read.

DestExpr

You can specify where the value of the field should be stored. You can find more information in the section using the destination expression. We’ve discussed the meaning of filters on text imports at the begin of the import section in this chapter.

Not Empty

Whether the field is accepted, if it has no value. You can use this in combination or as an alternative to a filter to only import the data, if a value is present.

Format Type

You can select the data type of the data that you want to import.

The following values are available:

Auto

The field is automatically interpreted, based on the target data type.

Date

The data is interpreted as a date. You can specify the format with the property Format String.

Time

The data is interpreted as time information. You can specify the format with the property Format String.

Date/Time

The data is interpreted as date/time information. You can specify the format with the property Format String.

Value Translation

Supported by Anveo EDI Connect 4.01 (Added in 4.00.12, but requires a reinstall of the module options)

We highly recommend to store the original value without translating it to a buffer table.

Sometimes you want to directly translate an imported value to another one. Using this format type, the data is interpreted using a value translation. You can specify which translation should be used using the property Value Translation.

Format String

Only available, if the property Format Type is set. Specifies the date/time format string, like described in working with date/time format strings.

Value Translation

Only available, if the property Format Type is set to the value Value Translation. Specifies the value translation that should be used to interpret the incoming data. The length check is done before, so you can truncate the value before translating it.

Use with care. We recommend storing the original value in a buffer table, whenever possible and translating it by using a post-processing.

Exporting Text Data

To export data, make sure that the mapping header property Direction is set to Export and configure the header properties first. Afterwards you can either create the lines by using the wizard, like described above, or add each line by hand.

Export Header Properties

Direction

Whether you want to import or export data. To export data from Microsoft Dynamics NAV 2016 into a text file, set this to Export.

Encoding

The encoding that should be used. Please note that the encoding are limited

Default

The internal encoding used by Microsoft Dynamics NAV 2016.

Windows-1252

Use the Windows encoding. Depending on the Microsoft Dynamics NAV 2016 installation it can be a different codepage than the Windows-1252. Whenever possible we use the internal encoding of Microsoft Dynamics NAV 2016 with the name “Windows”.

MS Dos

Use a DOS codepage.

IBM-500

Not supported in newer versions of Microsoft Dynamics NAV 2016 using the ServiceTier. A old mainframe encoding. Do not use anymore.

Default Field Type

You can mix fixed-length fields and fields that are separated by one or more control characters in the same mapping. This property specifies the default type, so that you do not have to choose it on every mapping line.

Fixed Length

The field length has to be specified and is a fixed count of characters.

Variable

The field is terminated by one or more control characters.

Default Limiter

You can use this property to specify global default values for the whole mapping. You can override this property on each EDI mapping line. Specifies the control characters that end a variable length field. You can use all special characters.

Default Length

You can use this property to specify a default length for fixed-length fields. You can override this value for each individual fields.

Fallback Communication Channel

This property was renamed in Anveo EDI Connect 4.00 and the value is now optional. Before you had to set a value, even if it was never used. The previous name was Communication Channel. The general logic hasn’t changed.

Specifies an EDI Communication Channel that is used to send the outgoing data, if it is not specified before. You can override this from C/AL and AL code, previous mappings and specify it using Business Transactions. This property is only used as a fallback, if not communication channel is set before.

Send Channel After Convert

Whether the data should automatically sent after converting this mapping. Usually it is a good idea to send the data automatically.

Fallback Receiver Partner

This property was renamed in Anveo EDI Connect 4.00.11 to better describe the functionality. The previous name was Receiver Party. The logic hasn’t changed.


Specifies an EDI Communication Partner that is used as the recipient for outgoing data, if it is not specified before. You can override this from C/AL and AL code, previous mappings and specify it using Business Transactions. This property is only used as a fallback, if not partner is set before.

Export Line Properties

After creating an EDI mapping line, you can configure the properties. We will only show the properties for EDI mapping lines with the Type property set to Data as the other properties behave like in any other mapping.

Field Name

The name is shown in the EDI Mapping Line as the first column. From a technical point of view, this has no effect on the mapping, but we recommend that you set it to the field name according to any documentation that may be available, or use a meaningful name for the field in some other way.

Field Type

You can specify whether the field has a fixed length or is separated by a control character.

Variable

The field is terminated by one or more control characters.

Fixed Length

The field has a fixed length.

Delimiter

This field is only available, if the property Field Type is set to Variable. Specifies the control characters that end a variable length field. You can use all special characters.

Start Escape

This field is only available, if the property Field Type is set to Variable. Specifies a start escape character, which will be written before the data.

End Escape

This field is only available, if the property Field Type is set to Variable. Specifies a end escape character. This character is written after the data, before the Delimiter.

Length

This field is only available, if the property Field Type is set to Fixed Length or the property Length Validation is set on a variable field. Specifies the count of characters that should be written. You can specify the padding character with the property Pad Char.

SourceExpr

You can specify where the value is coming from. You can find more information in the section using the source expression.

Format Type

You can select the data type of the data that you want to import.

The following values are available:

Auto

The field is automatically formatted, based on the source data type.

NAV Format String

You can use a format string, like you can use for the Microsoft Dynamics NAV 2016 build-in AL / C/AL function FORMAT.

Date

The data is formatted as a date. You can specify the format with the property Format String.

Time

The data is formatted as time information. You can specify the format with the property Format String.

Date/Time

The data is formatted as date/time information. You can specify the format with the property Format String.

Number

The data is formatted as a numeric value.

Format String

Only available, if the property Format Type is se to date/time or NAV format string.

If the property Format Type is set to NAV Format String, you can enter the format string, like described in the AL / C/AL help.

If set to date/time you can enter a format string, like described in working with date/time format strings.

Blank Zeros

If available, specifies that empty values should be outputted as an empty field instead of the default empty representation.

Decimal Character

Only available, if the property Format Type is set to Number. Specifies which character should be used as a decimal separator.

Thousands Separator Character

Only available, if the property Format Type is set to Number. Whether thousands should be separated and if, which character should be used.

Max. Decimal Places

Only available, if the property Format Type is set to Number. The maximal count of decimal places that should be outputted.

Min. Decimal Places

Only available, if the property Format Type is set to Number. The minimal count of decimal places that should be in the output. This will automatically fill the missing places with zeros.

Sign

Only available, if the property Format Type is set to Number. Whether to output the positive/negative sign.

Negative Only

Only output the “-” sign.

Always

Output the “+” and “-” sign.

Sign after Value

Only available, if the property Format Type is set to Number. Whether to put the sign after the numbers.

Length Validation

This field is only available, if the property Field Type is set to Variable. The possible actions are shared between converters, in this converter you can use a different field type
for fixed-length fields. The following values are allowed:

Ignore

Do not check the length of the output.

Max (Error)

Create an error if the value is longer than allowed.

Max (Truncate with Warning)

Create a warning if the value is longer than allowed and truncate the output to the allowed length.

Max (Truncate)

Truncate the value, is it is longer than allowed.

Max (Truncate…)

Truncate the value, is it is longer than allowed and add “…” at the end to show that the value is not complete.

Exact (Error)

Create an error if the output does not have the specified length.

Exact (Truncate/Pad with Warning)

Truncate or pad the value, if it has not the specified length and create a warning.

Exact (Pad)

Create an error if the value is longer than allowed. Pad the value if it is to short.

Exact (Truncate/Pad)

Truncate or pad the value to the given number of characters.

Alignment

This field is only available, if the property Field Type is set to Fixed Length or
the property Length Validation is set to pad the output. Where the output should be aligned, if the value is shorter than the character count to output.

Auto

Align depending on the source expression data type.

Left

Left align the value. This means the value is outputted first and afterwards the padding character is used to fill the field.

Right

Start with the padding and output the value right aligned.

Pad Character

This field is only available, if the property Field Type is set to Fixed Length or the property Length Validation is set to pad the output. Which character should be used for padding, if the value is not long enough.

WordPress Cookie Notice by Real Cookie Banner