Skip to main content
Solved

substring extractor


hlee1282
Participant
Forum|alt.badge.img
Hi all,

 

I have a field with the numberic part of an address. I would like to replace the last 2 digits with XX and combine it with the beginning part. I have gotten as far as using the SubstringExtractor to extract the last 2 characters, but how can I combine it with the first part?

 

 

Examples

 

I have:

 

123

 

12345

 

 

Need it to be:

 

1XX

 

123XX

 

 

What does the transformer do with the part of the string that doesn't get extracted???

 

 

Thanks!

 

 

 

Best answer by tdavis

If you just want to replace those last two to XX, then use the StringReplacer change "use regular expression" to Yes and text to match is ..$ and replacement text is XX.
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

Forum|alt.badge.img
  • Best Answer
  • June 4, 2014
If you just want to replace those last two to XX, then use the StringReplacer change "use regular expression" to Yes and text to match is ..$ and replacement text is XX.

hlee1282
Participant
Forum|alt.badge.img
  • Author
  • Participant
  • June 4, 2014
Thank you tdavis! Works perfectly! 

 

 

Maybe you can help me with the StringSearcher transformer. I have my matched and notMatched. What is the attribute name to expose to put the notMatched records into another attribute?

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