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?
Page 1 / 1
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
@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.
Have you tried the DateFormatter?