Skip to main content
Question

Replace text as number

  • October 12, 2020
  • 2 replies
  • 121 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.

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.

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+62

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.