I have an attribute that contains a string with ASCII control characters in it. I'd like to use the StringReplacer to either remove or replace those characters with something else. I see that I can select some characters (like the backspace character or the carriage return) from the Special Characters list inside FME's text editor, but the one I need isn't listed there. For example, the SOH (or start of heading) character is present in my data, but I can't match on it directly. What can I do to handle this?
Page 1 / 1
Great question! You can match on those types of characters by making use of the Match Regular Expression mode inside the StringReplacer. What you'll then need to do is look up the 2-digit hex code for the character you want to match on and use the following syntax inside the Text to Replace value: \\x<twoDigitCode>.
For example, if you want to match on the SOH character, you would need to set the Text to Replace to this: \\x01