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

Extract Folder Name List

EG_GBM
7 - Meteor

I wonder to know how Alteryx can extract folder names in a known path, thank you for everyone who can give me help!

The reality is that there are many folders in one path, and I need to know the names of the folders, but I think the directory tool can only extract the names of files in the path.

4 REPLIES 4
Emmanuel_G
13 - Pulsar

Hi @EG_GBM ,

 

The FileGetDir function can help in this case.

 

It takes as argument the full path to a file and returns the path to the folder.

 

You can then easily remove the data to extract only the name of the folder.

 

Find attached an example.

 

Emmanuel_G_0-1662641196993.png

 

Sarreddy
9 - Comet

 

 

 

Sarreddy_0-1662642859899.png

 

EG_GBM
7 - Meteor

Thank you for your prompt reply! But in fact there may no file in the folder,  because this task only needs to create folder.

 

In the real case, I need to create 4 levels folder, and in "Folder2" I need to return to the name of the existing folders (which may not contains any files), and then I can make judgments and do subsequent operations:

1) If the folder I need in "Folder2" has been created, I can create sub-folders inside it. 

2)If the folder I want has been not created, I can create the required folder and the corresponding subfolders. 

EG_GBM_1-1662689266798.png

Thanks for you help in advance!

sparksun
11 - Bolide

you can create Folder Path and judge if any folder exists or not by using function FileExists( )

 

I got the solution from the post below:

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Check-if-folder-exists-before-creating...

Labels