Skip to main content
Question

I have an attribute with dd:ddddd:sssssss and I want to trim this down to dd:ddddd only. Is StringFormatter the best transformer to use?

  • August 2, 2016
  • 3 replies
  • 87 views

jordiew
Participant
I have an attribute with dd:ddddd:sssssss and I want to trim this down to dd:ddddd only. Is StringFormatter the best transformer to use?
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.

3 replies

takashi
Celebrity
  • August 2, 2016

Hi @jordiew, there are some choices, but I think the SubstringExtractor is easier if the number of characters which should be extracted is fixed.

  • Start Index: 0
  • End Index: 7

ciarab
Contributor
Forum|alt.badge.img+9
  • Contributor
  • August 2, 2016

@jordiew You can use the AttributeTrimmer to trim off groups of different characters, its intended use is to remove things like leading and trailing characters so you could give that a go.

If the part of the attribute you are trying to remove can change length and characters, then AttributeSplitter might be more useful to you, splitting on ":" to create a list attribute containing the various parts of you original attribute from here you can create a new attribute by concatenating list elements 0 and 1 and placing a ":" in between the 2 list values.


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • August 2, 2016

Have you tried the DateFormatter?