Skip to main content
Question

Replace text as number

  • October 12, 2020
  • 2 replies
  • 101 views

user01
Contributor
Forum|alt.badge.img+2

Hello,

 

I have a text format attribute (lenght : 5 characters (for exple : FEFER, FOUSER,...)) as primary key and I want to change it in integer attribute format. Do you know about methods to do it ? I've tried ASCII conversion but it gives results more than the integer limit.

For exemple : I thought I could change each letter by the number (A->1, B->2, ...). How can I do it ?

 

Thank you for your help.

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+50

You'll need to split the attribute using an AttributeSplitter so you get the individual letters, then use a CharacterCodeExtrator to turn them into their ascii codes and a StringConcatenator or AttributeManager to create a new attribute that holds those 5 ascii codes.

ZZZZZ would give you 9090909090 which is indeed longer than the max length of a regular 32-bit integer. Does your output format support 64-bit integers (as primary keys)?


user01
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • October 12, 2020

My output format is 32 bit.

 

I have found the BaseConverter Transformer. I have converted base 64 to base 10. It works !

 

Thank you for your help.


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