Mangle

Using Mangle, Characteristics can be altered as DataSmith scans them. Mangle can remove extra spaces, change the case of text, add text to the beginning or ending of a characteristic, use variables to perform calculations, and find and replace text.

DataSmith will process mangled characteristics in the following order:

1.     Trim

2.     Lookup

3.     Lookup from file

4.     Prefix

5.     Suffix

6.     Format

Because DataSmith processes mangled characteristics in this manner, if you want to change the case of a characteristic and use Format to alter it, you will need to create two characteristics that highlight the same portion of the data file. The first characteristic will change the case of the characteristic, the second characteristic will use Format. The characteristic which changes the case must come before the characteristic that uses Format in the Config.

To access Mangle:

1.     Right click a Characteristic.

2.     Select Modify.

3.     Click Mangle.

4.     The Mangle dialog will appear:

Trim Leading Spaces

Trim Leading Spaces will remove any spaces before the characteristic's string. This option will be selected by default.

Trim Trailing Spaces

Trim Trailing Spaces will remove any spaces after the characteristic's string. This option will be selected by default.

Make Upper Case

Make Upper Case will change the case of the characteristic to all upper case.

Make Lower Case

Make Lower Case will change the case of the characteristic to all lower case.

None

By default, no Mangle option will be applied to the characteristic.

Prefix

Selecting the Prefix radio button and typing text in the field next to it will add the text to the beginning of the characteristic. Variables that can be used are: ~ord~, ~inc~,  ~this~, ~title~, ~ext~, and ~tilde~.

Suffix

Typing text in the field next to Suffix and selecting its radio button, will add the text to the end of the characteristic. Variables that can be used are: ~ord~, ~inc~,  ~this~, ~title~, ~ext~, and ~tilde~.

Format

In the Format field, variables and expressions can be used to alter the characteristic. Variables that can be used are: ~ord~, ~inc~,  ~this~, ~title~, ~ext~, and ~tilde~.

Lookup

The Lookup acts as a find and replace tool. The text you enter in the left hand side will be found and replaced by the text entered in the right hand side.

Lookup from File

The Lookup from File option allows you to use an external file to define the Change This/To This Lookup options. The file must have the extension *.4jlookup and exist in the same folder as the DataSmith file (*.4datasmith) in order for it to appear in the Lookup from File drop down menu.

Strings must be separated by a comma to indicate the "ChangeThis,ToThis".