Alteryx Designer Desktop Discussions

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

Required help in Trimming the last word

cghat
5 - Atom

HI,

 

I have an input like this

A, HEKOBO SOMTRI-SOMTRI
ALJKJERO, NAMI TA ZZZ-ONP32

 

 

and I need output like this
A, HEKOBO
ALJKJERO, NAMI TA

 

basically I want to remove the bold letter mentioned in the input, which is nothing but the word after the last space in the input.

 

thanks in advance

4 REPLIES 4
afv2688
16 - Nebula
16 - Nebula

Hello @cghat,

 

Try using this:

 

(.*\,.*)\s(.*)

 

What it does is just taking the last word after the last space and takes it off

 

Untitled.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

RolandSchubert
16 - Nebula
16 - Nebula

Hi @cghat ,

 

an option would be to find the first ' ' beginning at the end and cut the characters left to this space. Attached a sample. Hope this is helpful.

 

Best,

 

Roland

cghat
5 - Atom

Thank you

sagar91
6 - Meteoroid

HI what would be Regular expression to remove last two words after " , ". Eg, I have string True,True,False,True,True,Some,No. I want to make it True,True,False,True,True.

 

Basically want to remove last two words for any string. what would it be.

 

Thanks.

Labels