Solved

Can I use multi lines in Open Text Editor?

  • 31 October 2016
  • 2 replies
  • 6 views

Badge +3

I am trying to get the last 6 or 7 characters from an attribute called [event_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),M[1-9]),@StringLength(@Value(event_name))-@FindRegEx(@Value(event_name),M[1-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?

icon

Best answer by markatsafe 4 November 2016, 21:33

View original

2 replies

Badge +3
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!

 

 

Badge +2

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