Mangle

Topic Contents [Hide]Topic Contents [Show]
    1. Trim Leading Spaces
    2. Trim Trailing Spaces
    3. Make Upper Case
    4. Make Lower Case
    5. None
    6. Prefix
    7. Suffix
    8. Format
    9. Lookup
    10. Lookup from File

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:

Trim

Lookup

Lookup from file

Prefix

Suffix

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:

Right click a Characteristic.

Select Modify.

Click Mangle.

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.

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

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~.

If you were to type "ABC", when you look in the grid, the characteristic would start with "ABC".

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~.

Typing "XYZ" in the field would add "XYZ" to the end of the characteristic.

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~.

Add {~this~ * (-1)} to change all of the X Deviation characteristic values to negative.

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 Function in DataSmith

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.

Lookup File Format

Strings must be separated by a comma to separate the "ChangeThis" "ToThis":

Change This

To This

*dashOne

*-01

*dashTwo

*-02

*dashThree

*-03

*dashFour

*-04

 

 

Can we improve this topic?