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.
1. Right click a Characteristic.
2. Select Modify.
3. Click Mangle.
4. The Mangle dialog will appear:
Trim Leading Spaces will remove any spaces before the characteristic's string. This option will be selected by default.
Trim Trailing Spaces will remove any spaces after the characteristic's string. This option will be selected by default.
Spaces affect the label, so the result may not go in due to differences in the spaces of the feature label or the routine label.
Make Upper Case will change the case of the characteristic to all upper case.
Make Lower Case will change the case of the characteristic to all lower case.
By default, no Mangle option will be applied to the characteristic.
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~.
If you were to type "ABC", when you look in the grid, the characteristic would start with "ABC".
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~.
Typing "XYZ" in the field would add "XYZ" to the end of the characteristic.
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~.
Add {~this~ * (-1)} to change all of the X Deviation characteristic values to negative.
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.
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".