Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Use one Regex tool to split String with various spaces

Dear all,

 

i would like to split a string according the following table. The required informations are seperated with a different amount of spaces. Within the arcticle describtion (target column number 3) the amount of words can be differ also from row to row.

 

Inital situation:

\par 310035 272898 !!CL UNGARISCHE SALA 5 2 Wurst 082010 10-NOV-20 698862 06:59:22 07:14:08 07:00:15

 

Target:

310035272898!!CL UNGARISCHE SALA52Wurst8201010-Nov-20698862 06:59:2207:14:0807:00:15

 

Is it possible just to split this string with one regex tool, or do I need more tools? I would appreciate your support.

 

Thanks in advance,

Alex

22 REPLIES 22
atcodedog05
22 - Nova
22 - Nova

Hi @Alexander_Gruber_FhA 

 

Please find the updated workflow adjusted to the scenario.

 

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

Hi

thanks for the quick response.

There is still the problem in column "RegExOut7". The regex is not splitting the number and the date in two seperate columns.

Br,

Alex

atcodedog05
22 - Nova
22 - Nova

Hi @Alexander_Gruber_FhA 

 

Fixed it.

atcodedog05_0-1605702556335.png

Hope this is right now 🙂

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @Alexander_Gruber_FhA 

 

Cheers and Happy Analyzing 😀

 

Feel free to reach out if you face any other issues 🙂

Hi @atcodedog05  again,

please believe me, that I´m very sorry that i have to ask again.

 

But with the regex function there is another problem:

\par003135882279!!CLUNGARISCHESALA52Wurst08201010-NOV-2069886206:59:2207:14:0807:00:15
\par●G13135●●●882279●!!CL●UNGARISCHE●SALA●●●●●●●●●●5●2●●●Wurst●●●●●●082010●10-NOV-20●●●●●●●●●●●●698862●●●●●06:59:22●07:14:08●07:00:15

 

It is possible that information 2 starts with a letter (green colour) instead of a number. In this case the regex function did not work.

May you please support again. Thank you very much!

Alex

atcodedog05
22 - Nova
22 - Nova

Hi @Alexander_Gruber_FhA 

 

Here is the updated workflow

Output:

atcodedog05_0-1605714032163.png

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

seven
12 - Quasar

@PhilipMannering 

 

why use two tools? Regex and Formula?

 

Why not use one tool? Instead of using a Tokenize operation, use a replace operation. Regex_replace

\S+

with ' '.

PhilipMannering
16 - Nebula
16 - Nebula

@seven If you show me a workflow where that works, then I'll agree with you!

Hi @atcodedog05,

 

still two problems:

 

1.)

Initual situation:

\par 003135 704780 CL LANDJAeGER 200 G 1 2 Wurst 082021 10-NOV-20 698862 06:59:22 07:14:08 07:00:27

After regax:

LANDJAeGER 200 G12Wurst 08202110-NOV-20698862 06:59:2207:14:08 07:00:27

I´m not quiet sure why this happens, when the strings looks like the example from the initual situation?

2.)

\par 004060 779349 BILLA KAKAOMILCH 250 10 1 Obst - FD 026045 10-NOV-20 777094 20:25:53 21:35:33 21:00:52

 

If information 4 contains of 2 numbers (green colour), regex didn´t work.

Thanks for your support,

Alex

Labels
Top Solution Authors