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.

binuacs
20 - Arcturus

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

binuacs_0-1658002638775.png

 

binuacs
20 - Arcturus

@Joker_Hazard Another way of dong this with the string functions

binuacs_0-1658003183641.png

 

Labels