Alteryx Designer Desktop Discussions

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

RegEx tool: Spilt into two columns

GARCIAJ8
5 - Atom

Can you help me split this data into two columns?

0123-4869 - Asset Cat 23

4589-6592A - Jones Switch

FAC24360 - Build Hydro
0001-4578 - Cart. ISW4596 -  Row

FDU2314 - 42509 SQ FT Warehou

6LIFD87 - 3" NIT53: ONE

 

I am trying to split into two columns and for the results to look like this

0123-4869Asset Cat 23
4589-6592AJones Switch
FAC24360Build Hydro
0001-4578Cart. ISW4596 - Row
FDU231442509 SQ FT Warehou
6LIFD873" NIT53: ONE
4 REPLIES 4
IraWatt
17 - Castor
17 - Castor

Hey @GARCIAJ8,

Here is one way to do this:

IraWatt_0-1658247755131.png

 

Regex is not always perfect but my regex creates a group on the first word then creates another group on all the other text.

 

If you want to learn more about Regex the community has some really quick interactive videos on getting to grips with it here: https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Parsing%20... 

 

Any questions or issues please ask :)
HTH!
Ira

Luke_C
17 - Castor

Hi @GARCIAJ8 

 

Based on your data you don't need regex:

  1. Text to columns on the first space
  2. Remove first 2 characters

Luke_C_0-1658247902684.png

 

 

IraWatt
17 - Castor
17 - Castor

Just to breakdown my Answer a bit:

(\<\w+\>)\s-\s(.*)

The brackets () creates the two groups. Group 1 (\<\w+\>) is a word  then \s-\s is the space the dash and another space. Finally the last group captures everything else (.*) .

 

 

binuacs
20 - Arcturus

@GARCIAJ8 one way of dong this

 

binuacs_0-1658268197660.png

 

Labels