Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

split by upper case before lower case

vlad_kutateladze
8 - Asteroid

Hi, 

Is it possible to split string, not just by upper case, but only if after upper case comes before lower case, and to keep all other upper cases together?  Thanks. 

 

Input  

 

Vlad_Kutateladze_2-1593506286617.png

 

Output 

Vlad_Kutateladze_1-1593506197757.png

 

 

 

4 REPLIES 4
AngelosPachis
16 - Nebula

Hi Vlad,

 

I came up with this solution which is a bit hardcoded but I think it does exactly what you want. Essentially you break down each word in its letters and check when an uppercase letter is followed by a lowercase letter. If a letter meets that criteria, you substitute that letter with a whitespace and move the letter ID by one position.

 

Annotation 2020-06-30 125024.png

 

Please let me know if it works for you.

 

Cheers

CKP
10 - Fireball

Hi @vlad_kutateladze 

 

Here's a workflow that I believe produces the result you're looking for. It's probably not the simplest method but it's a method.

 

Split by Case.jpg

 

I hope this helps.

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @vlad_kutateladze,

 

I would probably go down the route of two RegEx formulas to solve this:

 

Formula 1: REGEX_Replace([Field1], '([A-Z])([a-z])', ' $1'+'$2',0)

Formula 2: TRIM(REGEX_Replace([Field1], '([a-z])([A-Z])', '$1 '+'$2',0))

Jonathan-Sherman_0-1593519121782.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

 

kishorerabhinav
7 - Meteor

Thanks for the solution. Worked best for me for the same use case.

Can you please help me in understanding this? I want to understand how to apply such logic to other use cases as well.

Labels