Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to select a folder specific using input tool. and then select a particular sub-file

APIUserOpsGiri
7 - Meteor

I have a large directory with multiple folders, I'm trying to locate a particular folder in it (the folder name has a suffix date ending eg- abcd_ef_YYYYMMDD) using the input tool and later find a sub-file in it. How can I do it?

4 REPLIES 4
Felipe_Ribeir0
16 - Nebula

If this folder has files inside of it, you can point the directory tool to a root folder that contains this specific folder, and with the Include SubDirectories options enabled:

 

 

Felipe_Ribeir0_0-1673371232319.png

 

And then, use the filter tool to filter the pattern name. REGEX_Match([FullPath], '\w{4}_\w{2}_\d{8}') formula wold work if your pattern name for this folder is 4 letters_2 letters_8 numbers

 

Felipe_Ribeir0_1-1673371356114.png

 

 

APIUserOpsGiri
7 - Meteor

This sounds like a great option, I tried the exact method but unfortunately, I have a zillion files and using sub-files would take a decade to complete.. I need a method that doesn't use sub-files instead select the folder exactly.

Felipe_Ribeir0
16 - Nebula

@APIUserOpsGiri I see, unfortunately with just Alteryx i dont think that you gonna find another option than using the directory tool.

 

One possible workaround is by using cmd/python/R to list the directories and see if it performs better. I think that it will perform better.

https://stackoverflow.com/questions/973473/getting-a-list-of-all-subdirectories-in-the-current-direc...

 

Felipe_Ribeir0
16 - Nebula

@APIUserOpsGiri 

 

Here it is, try the attached workflow. Just replace your root directory on the text input tool and run it, it should work. It will list all directories inside of the provided root directory, without looking at the files inside of them. I believe that this will be a lot faster for you.

 

Felipe_Ribeir0_0-1673439701496.png

 

Labels