AttributeTrimmer
Removes leading and trailing trim characters from selected attributes.
Input Ports
The feature type that contains the attribute you want to trim.
Output Ports
Features with the selected trimmed attribute.
Parameters
After you connect this transformer, click the Browse button and choose from the list of attributes.
Characters may be trimmed from the right, left, or from both sides.
Enter individual characters to be trimmed. Characters will be trimmed from beginning, end, or both the beginning and the end, depending on the Trim Type selection.
If you do not specify a trim character, white space is removed (spaces, tabs, newlines, and carriage returns).
Note: To remove an entire text string, use the StringReplacer.
Characters can be expressed as regular characters but they can also include any number of control characters.
Special character sequences (Advanced Editor only) are interpreted as shown below:
Sequence | Description |
---|---|
Ctrl+Shift+h (^H) |
Backspace (0x08) |
Ctrl+Shift+l (^L) |
Form feed (0x0c) |
Ctrl+Shift+j (^J) |
Newline (0x0a) |
Ctrl+Shift+r (^M) |
Carriage return (0x0d) |
Ctrl+Shift+i (^I) |
Tab (0x09) |
Ctrl+Shift+k (^K) |
Vertical tab (0x0b) |
Defining Special Characters
You can define special characters through the Basic or Advanced Editors. Click Open Editor from the parameter menu:
Basic Text Editor
Select Constant from the String Type column (or, in some transformers, the Value column) and click on the empty field in the column:
Click the browse button to the right of the column to open an Edit Value dialog. In this editor, enter characters using the shortcut keys from the table above.
Advanced Text Editor
Enter characters using the shortcuts from the table above.
Note: To see tab characters, click the Options menu on the bottom left and select Show Spaces/Tabs.
If a given attribute value contains only Trim Characters, the character that remains depends on the Trim Type: for Both it will be the middle character, for Left it will be the last character, and for Right it will be the first character.
If the Allow Trim Down to Nothing option is set to No, the output of the trimming will have at least one character remaining.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.
Tags Keywords: StringTrimmer