Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
RÉSOLU

Parsing using regex

lavorarchi
Météore

Hi would appreciate some help with parsing using REGEX the following data

 

Input Data

Total 123-456 Description of the total

500000 Description of item

600-123 Another line description

 

Irrespective of the lines in each cases I need to parse the "123-456" , "500000" and "600-123" in one column and in another column I need the remaining descriptions e.g. Total Description of the total, Description of item and "Another line description" using the example above. 

4 RÉPONSES 4
mpennington
Bolide

I think this should work:

 

Parse Regex.jpg

 

Edit: Corrected image and workflow, missed one case. Sorry for the confusion.

 

lavorarchi
Météore

Hi @mpennington @thank you very much. I have noticed the 2nd row is not parsing the numbers from the description. How can I fix that? 

mpennington
Bolide

Sorry about that, I fixed it above.

 

The RegEx:

REGEX_Replace([Input Data],".*(\d{3}-\d{3}|\d{6}).*", "$1")

 

lavorarchi
Météore

Much appreciated thank you.

Étiquettes