Alteryx Designer Desktop Discussions

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

How to extract word in between specific words

RamyaGunasekaran
7 - Meteor

Example I have,

 

\\abcd123\aa\bb\cc\zip\folder1

\\abcd321\dd\zip\foldername1\gg

\\abdc213\aa\bb\cc\dd\zip\folder3\ee\ff

 

I want folder names as output like

folder1

foldername1

folder3

 

Help on this!!

10 REPLIES 10
Jean-Balteryx
16 - Nebula
16 - Nebula

Hi @RamyaGunasekaran ,

 

I guess your folders doesn't always contain the word "folder" ?

RamyaGunasekaran
7 - Meteor

No it can be different name but following by zip folder

Jean-Balteryx
16 - Nebula
16 - Nebula

There is always "zip" before ?

atcodedog05
22 - Nova
22 - Nova

Hi @RamyaGunasekaran 

 

You can use regex like below. Filename after zip\

 

zip\\(\w+)\\?

 

 

Workflow:

atcodedog05_0-1626957127718.png

 

Hope this helps : )

 

Jean-Balteryx
16 - Nebula
16 - Nebula

@RamyaGunasekaran here is a workflow with a regex extracting the folder name !

Jean-Balteryx
16 - Nebula
16 - Nebula

@atcodedog05 got it before me !

RamyaGunasekaran
7 - Meteor

Above solution is working fine. But I got another case like below. Not only following by zip folder also by Bias folder

 

\\abcd123\aa\bb\cc\zip\folder1

\\abcd321\dd\zip\foldername1\gg

\\abdc213\aa\bb\cc\dd\Bias\folder3\ee\ff

\\abcd321\dd\Bias\folderNam6\hh

 

Expected Output:

folder1

foldername1

folder3

folderNam6

 

Help on this..

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @RamyaGunasekaran 

 

You can use regex like below.

 

 

(:?zip|Bias)\\(\w+)\\?

 

 

Workflow:

atcodedog05_0-1627301876794.png

Hope this helps : )

RamyaGunasekaran
7 - Meteor

In case if I have space in folder name, am not getting the complete name  of the folder like below

 

\\abcd123\aa\bb\cc\zip\folder1 subname\folder2

\\abcd321\dd\zip\foldername1_tt\gg

 

Expected Output:

folder1 subname

foldername1_tt

 

The ouput which am getting is

folder1

foldername1_tt

Labels