community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Use Regex to split string

Highlighted
Meteor

Dear all,

 

I run into a problem when splitting a string and regrouping it based on different criteria. I tried various formulas and workflows and I am still stuck to find a structured workflow. 

 

The initial data looks like :

001ABC 123 M @#
001ABC 798 M @#
001ABC 7 @#
001ABC @
002F 421 #
003GHJK 433 @
003GHJK @

 

What output should be is :

 

001ABC123 M@#
001ABC 798 M @#
001ABC7@#
001ABC @
002F421#
003GHJK 433@
003GHJK  @

 

Many thanks for your input.

^([^ ]+) (.*?) ?([^ ]+)$

should do what you need.

 

The first column will be up to the first space. The last column will be from the last space.

The middle column will only be filled if there is a middle block

 

Sample attached

Meteor

Thank you ! This looks great!

Labels