Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Regex - Extracting text from a column with spaces, brackets and -

sriniprad08
11 - Bolide

Hi Team,

 

Hope you are well. I need help. I have column and i need to extract the text from the column.

 

Please find attached the input and output.

 

Thanks,

Sr

14 REPLIES 14
OllieClarke
15 - Aurora
15 - Aurora

Sorry @sriniprad08 just seen your post about removing the brackets,

 

A couple of ways to do this, if it's just brackets then this formula will do the trick

ReplaceChar([Output],'()','')

Alternatively you can use a RegExReplace() to remove anything which isn't a letter, number, underscore or hyphen with this:

RegexReplace([output],'[^\w-]','')

OllieClarke_0-1642173118507.png

 

Ollie

 

atcodedog05
22 - Nova
22 - Nova

Hi @sriniprad08 

 

To add to above another option to remove brackets is using Trim function like below.

 

Trim([Sit_1],"()")

 

Hope this helps : )

sriniprad08
11 - Bolide

Hi @atcodedog05 ,

 

Thank you for the help 🙂 Can you please help me one more thing ? Please find attached the input and the output.

 

The only difference is the one marked in red should be there in the ouput. thanks again.

sriniprad08_0-1642175406216.png

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @sriniprad08 

 

Give this a try.

 

atcodedog05_0-1642175815641.png

 

Hope this helps : )

 

sriniprad08
11 - Bolide

Hi @atcodedog05 ,

 

Thank you very much :). I will go through it and let you know. 

 

Cheers,

Sr

Labels