Skip to main content
Solved

Can I use multi lines in Open Text Editor?


arnold_bijlsma
Enthusiast
Forum|alt.badge.img+14

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?

Best answer by markatsafe

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.

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

arnold_bijlsma
Enthusiast
Forum|alt.badge.img+14
  • Author
  • Enthusiast
  • October 31, 2016
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!

 

 


Forum|alt.badge.img+2
  • Best Answer
  • November 4, 2016

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings