Skip to main content
Solved

Need a transformer to filter by amount of characters given

  • December 15, 2016
  • 7 replies
  • 141 views

Hi,

I am looking for a transformer to filter by the amount of characters.

for example I have a set of ID numbers and I need to extract all the Id's that are only 18 characters long.

Help please !

Thanks,

Samuel

Best answer by itay

Hi @sspag1I would use the StringLenghtCalculator and test the string length attribute in a tester.

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.

7 replies

itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • Best Answer
  • December 15, 2016

Hi @sspag1I would use the StringLenghtCalculator and test the string length attribute in a tester.

Hope this helps


pratap
Contributor
Forum|alt.badge.img+12
  • Contributor
  • December 15, 2016

Hi,

Use stringlengthcalculator and tester to filter out


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • December 15, 2016

I would use the AttributeValidator transformer and test on the validation rule "Maximum length".


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • December 15, 2016

I would use the AttributeValidator transformer and test on the validation rule "Maximum length".

Nice one @erik_jan, didn't consider it, guess I'm stuck thinking the 'old way' sometimes...

 


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • December 16, 2016

Hi @sspag1I would use the StringLenghtCalculator and test the string length attribute in a tester.

Hope this helps

No need to calculate string length outside of the tester unless you want to store for later use. It can be done in one tester

 

 


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • December 16, 2016
No need to calculate string length outside of the tester unless you want to store for later use. It can be done in one tester

 

 

True and I would personally use the function in the transformer, it's sometimes not that easy to guess the expertise level of a user so I usually tend to provide the easiest solution.

 

 


  • Author
  • December 20, 2016

Hi @sspag1I would use the StringLenghtCalculator and test the string length attribute in a tester.

Hope this helps

Thanks itay

 

I eventually worked it out and did exactly this

 

Thanks for the reply