Skip to main content

I am trying to get the last 6 or 7 characters from an attribute called ievent_name], and am using the built-in Open Text Editor on the AttributeManager transformer to extract this substring. But it comes out like this:

@ReplaceString(@Substring(@Value(event_name),@FindRegEx(@Value(event_name),Mn1-9]),@StringLength(@Value(event_name))-@FindRegEx(@Value(event_name),Ma1-9])),-,_)

which I think looks horrible and is difficult to understand. Is there a way I could break this down into multiple lines with local variables, like you do in a Python startup script?

As an alternative way to solving my string problem, I managed to have a SubstringExtractor transformer followed by a StringReplacer transformer.

 

But the original question whether one can have multiple lines rather than nested functions in the Open Text Editor or the Open Arithmetic Editor still stands!

 

 


You can't have multiple lines, but AttributeManager in FME 2016.1 and up now supports referencing attributes you created earlier in the AttributeManager table. So you could split your expression into logical parts using temporary attributes. That might help for documentation purposes.


Reply