Skip to main content
Solved

Can I use multi lines in Open Text Editor?

  • October 31, 2016
  • 2 replies
  • 61 views

arnold_bijlsma
Enthusiast
Forum|alt.badge.img+15

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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+15
  • Author
  • Enthusiast
  • 125 replies
  • 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
  • 1891 replies
  • 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.