Alteryx Designer Desktop Discussions

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

Extracting Text from Data Column Using Regex

Inactive User
Not applicable
Hello, I need help with extracting text please. My data includes , and | as separators and I am trying to determine how to only extract the data relating to the | separator. See below expected result where I am ignoring the data from any , separator. I hope there is a way. I've played around with Regex for days now with no luck. Any help is appreciated.
6 REPLIES 6
BrandonB
Alteryx
Alteryx

It might be easiest to use the text to columns tool instead with | as the delimiter

Inactive User
Not applicable

Hi Brandon,

 

First off, I am thank full for the quick support and you time.

 

I've just added the example image which may explain my predicament. If I use text to columns, it will also do the same for any other data before or after the | separator. If there is a way I can only extract the data before/after this one unique separator, that would be perfect. If there is another approach I  can try, please feel free to suggest anything.

 

Screenshot_1.jpg

 

 

CharlieS
17 - Castor
17 - Castor

The Text to Columns tool can use multiple delimiters, like "|" and ",". Since the arguements are all word characters (a-zA-Z_0-9), then the RegEx tool can Tokenize (split to columns) using the expression "\w+".

 

Check out the attached workflow for an example of both methods. 

Inactive User
Not applicable

Hi Charlie,

Thank you for the response. Both solutions will work. 

benakesh
12 - Quasar

"extract the data before/after  | "  : why  FA15  in first row not included in perfect scenario   ?  

Inactive User
Not applicable

Hi Benakesh,

That was my ideal solution where I dont have to use text to column to split both , and | in to columns but only get the single data that is before or after the | extracted to the separate column. Hope that makes sense. 

With the solution's provided however, I will get all the words split in to columns and using a formula to remove those unwanted splits to blank fields so in the end I have only the data I needs as above. 

Labels