Skip to main content
Solved

String: select line from multi line attribute

  • September 15, 2018
  • 2 replies
  • 179 views

harmen_kampinga
Forum|alt.badge.img+2

Hi all,

I have a multi line string and like to do some adjustments.

For example: remove the first line of the multi line string

How do I select the first line or the first two lines?

Thanks in advance!

Best answer by takashi

Hi @HarmenKampinga, a possible way I can think of is:

  1. split the multi-line string by the newline character with the AttributeSplitter
  2. explode the resulting list with the ListExploder,
  3. filter out undesired lines with the Tester (test the "_element_index" added by the previous ListExploder),
  4. then concatenate remaining lines using the Aggregator (use the "Attributes to Concatenate" option).

Hope this helps.

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

takashi
Celebrity
  • 7843 replies
  • Best Answer
  • September 15, 2018

Hi @HarmenKampinga, a possible way I can think of is:

  1. split the multi-line string by the newline character with the AttributeSplitter
  2. explode the resulting list with the ListExploder,
  3. filter out undesired lines with the Tester (test the "_element_index" added by the previous ListExploder),
  4. then concatenate remaining lines using the Aggregator (use the "Attributes to Concatenate" option).

Hope this helps.


harmen_kampinga
Forum|alt.badge.img+2

Hi @HarmenKampinga, a possible way I can think of is:

  1. split the multi-line string by the newline character with the AttributeSplitter
  2. explode the resulting list with the ListExploder,
  3. filter out undesired lines with the Tester (test the "_element_index" added by the previous ListExploder),
  4. then concatenate remaining lines using the Aggregator (use the "Attributes to Concatenate" option).

Hope this helps.

It helps indeed. Just perfect.

 

Now I need to create a structure, XML style. But I will sort that out.