We are in the final days to enter our Data and Analytics - "What's your why?" raffle with SparkED!

Reply with your "why" in text/video format to our forum post by January 28 to be entered! 

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
binuacs
12 - Quasar

@sriniprad08 

 

Trim(REGEX_Replace([Sit], '(.*)(\s)', "$2"))

 

binuacs_0-1642163292081.png

 

atcodedog05
21 - Polaris

Hi @sriniprad08 

 

My take on this

 

Formula:

REGEX_Replace([Sit], "[^\s]+\s[^\s]+\s(.+)", "$1")

 

Workflow:

atcodedog05_0-1642163561946.png

 

Hope this helps : )

 

sriniprad08
10 - Fireball

Hi @binuacs ,

 

Thank you so much. I need help with the below please . Can you please let me know how to go about it?

 

Cheers,

Sr

sriniprad08
10 - Fireball

Hi @atcodedog05 ,

 

Thank you so much. 🙂 I need one more help I have attached the file. Can you please help me with that?

 

Cheers,

Sr

atcodedog05
21 - Polaris

Hi @sriniprad08 

 

Give this a try.

 

Hope this helps : )

binuacs
12 - Quasar
sriniprad08
10 - Fireball

Hi @atcodedog05 ,

 

Thank you for the help. Is it possible to remove the bracket from the below output after extracting it. Like below please only with KERATE and not bracket in a separate column with all other values.

 

 

Thanks

Sr

sriniprad08_0-1642172437966.png

 

 

 

atcodedog05
21 - Polaris

Hi @sriniprad08 

 

Please find the updated workflow.

 

Formula:

REGEX_Replace([Sit], "[^\s]+\s[^\s]+\s\(?([^)]+)\)?", "$1")

 

Hope this helps : )

OllieClarke
14 - Magnetar
14 - Magnetar

Hi @sriniprad08 

 

Lots of solutions already, but here's how I would do this:

OllieClarke_0-1642172627253.png

Parsing 

.* (.+)

which will output everything after the final space into a new column

 

Hope that helps,

 

Ollie

 

Labels