Alteryx Designer Desktop Discussions

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

Split string using regex

hkanp
6 - Meteoroid

Hi,

 

Is there a method to split below strings to 3 columns ?

 

50 38

28-32

401/28-32

401 28-32

 

Thanks,

 

 

9 REPLIES 9
grazitti_sapna
17 - Castor

Hi @hkanp , the simplest way would  be to replace characters such as / and - with a space and then use text to column using space as delimiter and it will work. Please follow the screenshoat and workflow for understanding.

I hope it helps!

Thanks.

grazitti_sapna_0-1591941753136.png

 

Sapna Gupta
DavidP
17 - Castor
17 - Castor

You can also use multiple delimiters in a single Text to columns tool, so putting \s-/ in the delimiter field would split the split the field by all 3 (\s represents a space)

 

DavidP_0-1591943233778.png

 

jdunkerley79
ACE Emeritus
ACE Emeritus

You can do this directly in the Text to Columns tool and list all 3 valid delimiters in the input like:

jdunkerley79_0-1591943380879.png

 

hkanp
6 - Meteoroid

Hi all

 

Thank you so much for all the quick responses.

One more thing,

How do i split the addresses as below into different columns ?

 

hkanp_0-1591944761285.png

 

Thanks,

grazitti_sapna
17 - Castor

@hkanp , try this solution I hope it works.

Thanks.

grazitti_sapna_0-1591949041064.png

 

Sapna Gupta
hkanp
6 - Meteoroid

Hi @ 

 

This is perfect, only one thing,

 

if there are any addresses like "RecordID= 1" (ex: 1 Pacific hwy")

I want to move number to "Street No 1" column instead "Unit No" column.

All the other addresses are split correctly.

 
 
 
 

Aleryx1.JPG

 

Much appreciated your support

 

Thanks,

 

 

grazitti_sapna
17 - Castor

@hkanp , please find the solution below I have modified the workflow.

Thanks!

 

grazitti_sapna_0-1591953736300.png

 

Sapna Gupta
hkanp
6 - Meteoroid

Hello @

 

Much appreciated your help so far,

 

Im still struggling to split the below patterns to appropriate columns.

Could you please help me ?

 

hkanp_0-1592008035910.png

 

Thanks

hkanp
6 - Meteoroid

I was able to fixed the issue.

 

Thank you so much your help

 

Much appreciated

 

Thanks !

Labels