Alteryx Designer Desktop Discussions

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

Regex ,split

Nandy
8 - Asteroid

Hi Guys,

 

i have a scenario where i have a string like BB(SPACE)(SPACE)R(SPACE)DD(SPACE)(SPACE)A.

 

I need output as BB  R,DD  A.  That is always 5 characters & 5 characters include space sometimes or may not have spaces like WBBBCDEEES as WBBBC , DEEES.

 

which regex function would satisfy both?

 

Thanks,

Nandy

 

 

19 REPLIES 19
MarqueeCrew
20 - Arcturus
20 - Arcturus

@Nandy ,

 

 have you tried something simple, like:

 

left(field,5)+","+right(field,5) 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Nandy
8 - Asteroid

Marq,

 

i would need a code to satisfy cases like that as well as cases where there are no spaces like .

 

I have list of different rows , example one would be CA  T FA  T --I want this as CA  T,FA  T

another one would be APPLETANGO as APPLE,TANGO.

 

Thanks,

Nandy

MarqueeCrew
20 - Arcturus
20 - Arcturus

I'm confused. If the total length of each part is 5 characters long,  why not parse with the left () and right() function's?

 

 Cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
afv2688
16 - Nebula
16 - Nebula

Forget it, understoood something different

afv2688
16 - Nebula
16 - Nebula

Hello @Nandy,

 

I think I got it right now:

 

Since I don't know if you wanted the data in the same cell or in different I give you both options.

 

Untitled.png

 

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

Regards

Nandy
8 - Asteroid

Hi ,

 

Great thanks , but i face another scenario if i use it. 

 

Sometimes the data has leading white spaces in front or at the end of & data includes numbers as well.

 

Attached the scenario. think need small alterations in the workflow .

 

Thanks,

Nandy

afv2688
16 - Nebula
16 - Nebula

Hello @Nandy,

 

The formula tool removes all the trailing and leading whitespaces. If you need them or want them you just need to remove the tool.

 

If it is something else you want I couldnt understand you well.

 

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

Regards

Nandy
8 - Asteroid

Hi ,

 

The point i was trying to say is there are spaces in between strings ,

example AR(space)(space)D(space)DEEAK what happens to this is ,

it comes out as AR(Space)(space)D,(Space)DEEA. 

 

Above case i would need AR  K,DEEAK whereas the K is left because of the space considered between the strings.

Similar DE(space)(space)K(space)FJGE6-result as DE(Space)(space)K,(Space)FJGE.

 

I mean to say there would be always 5 characters including spaces , but not starting with spaces.

examples of strings AC  D GAABI-->AC  D,GAABI

 

Thanks,

Nandy

OllieClarke
15 - Aurora
15 - Aurora

hI @Nandy How about this:
\s*(.{5})\s*(.{5}) 

Which will parse out 5 character strings, but will ignore any leading spaces for those strings

OllieClarke_0-1580897973168.png

 

Ollie

Labels