Alteryx Designer Discussions

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

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

sriniprad08
10 - Fireball

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
14 - Magnetar
14 - Magnetar

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
21 - Polaris

Hi @sriniprad08 

 

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

 

Trim([Sit_1],"()")

 

Hope this helps : )

sriniprad08
10 - Fireball

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
21 - Polaris

Hi @sriniprad08 

 

Give this a try.

 

atcodedog05_0-1642175815641.png

 

Hope this helps : )

 

sriniprad08
10 - Fireball

Hi @atcodedog05 ,

 

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

 

Cheers,

Sr

Labels