In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to edit string and add dots?

Joker_Hazard
11 - Bolide

Hi all.

I am trying to take this string: 13374147000193 and edit to became like this: 13.374.147/0001-59

 
The one issue I encountered is that sometimes some strings come with less than 14 caracthers, so it needs to add zeros to the right side for example:

135576000142 -> needs to become: 00.135.576/0001-42

 Would regex be the best option here?

Thanks
3 REPLIES 3
Amol_Telore
11 - Bolide

Hey @Joker_Hazard 

 

First, you will need to use the formula tool to add leading zeroes in the field.

 

Formula:- 

PadLeft(tostring([Field1]),14,"0")

 Then use the regex tool in Replace mode.

 

Regex expression:-

 

(^\d{2})(\d{3})(\d{3})(\d{4})(\d{2})

 

 

Replace Expression:-

 

$1.$2.$3/$4-$5

 

Hope I have answered your question.

binu_acs
21 - Polaris

@Joker_Hazard One way of doing this, similar to @Amol_Telore method

binuacs_0-1658002638775.png

 

binu_acs
21 - Polaris

@Joker_Hazard Another way of dong this with the string functions

binuacs_0-1658003183641.png

 

Labels
Top Solution Authors