How to remove letters/chars preceding last '-' in a string
Hi all, i have a column comprising of text of letters and characters followed by country name -> SC/K-UGANDA, SN/KG-AMERICA,TT-NG-PERU ......etc. I only want to populate the country name.
Please advise how i can do this using recipe in DataIKU or what step/code can i add.
Thank you for your kind attention and advice.
Regards
Aminmin
Operating system used: IOS
Best Answer
-
Jurre Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts, Registered, Dataiku DSS Developer, Neuron 2022 Posts: 115 ✭✭✭✭✭✭✭
That's what i like about this application : options to discover
thanks for the tip @Manuel another option would be splitting the column on '-'and truncating the outcome to the last occurance of that '-'. or the last two if '-'-containing countries is a concern.
cheers!
Answers
-
Manuel Alpha Tester, Dataiker Alumni, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 193 ✭✭✭✭✭✭✭
Hi,
In a Prepare recipe, add a "Extract with Regular Expression" processor and then use the Smart Pattern Builder.
//play.vidyard.com/5RLFrHK4dEPFwuV7BoV8kZ.html?
I hope this helps.
-
Hi Manuel, thanks for the tip. But i am not able to find the Smart Pattern Builder. Maybe mine is a lower version. However, really appreciate your kind advise as i now know the existence of this builder. Thank you and have a great weekend!
-
Hi Jurre, greatly appreciate your prompt reply. Your solution works for me...Have a great weekend!!