Alteryx Designer Desktop Discussions

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

Import Multiple Folders with One Directory Tool?

ddiesel
13 - Pulsar
13 - Pulsar

I'm starting a new project today and I'm working on bringing in files from multiple folders.

 

Example Directory Structure:

 

Capture.PNG

 

 

If my objective is to bring in everything from folders containing "ABC", can it be done without using multiple directory tools? There are hundreds of sub folders... not just three.

 

Capture.PNG

 

 

Can this be accomplished in one step?

 

 

5 REPLIES 5
Garrett
11 - Bolide

How about a more open ended Directory tool, followed by a Filter tool?

 

Ignore the error; I don't have a C:\Data\ folder.Ignore the error; I don't have a C:\Data\ folder.

 

 

ddiesel
13 - Pulsar
13 - Pulsar

@Garrett

 

So this works but it's so slow. 36 minutes to process due to the number of sub folders and contents.

 

Is there a way to use a Directory tool to find the folders I need and then bring in full path of the contents of those folders?

JoshuaM
8 - Asteroid

@Bolide

I believe you can optimize @Garrett's solution to only include folders specific to "ABC" (see below).

I had a similar situation and only wanted a File Specification of "Jan".

Using the below approach I retrieved the full path for files within the folder "01 Jan" and sub folder labeled "Jan 01".

There was another sub folder labeled "Feb 02" which was neglected.

This should hopefully help optimize your workflow as I believe the original approach would have to bring in every field to filter out those containing "ABC"

Directory.PNG

pbrink
8 - Asteroid

Is there a way once you have the files you need to then push them out to a new directory or folder? Thanks

JoshuaM
8 - Asteroid

@pbrink

 

Yes, the way I handled this was to edit the "Directory" output field from the Directory tool.

Add a summarize after the Directory tool and group by the Directory field.

Then just dynamically replace the fields within the current file path.

(Below I simply removed the current folder "Submissions" and essentially saved the data as a sheet ("Data Source") in an existing excel template.) 

 Directory_reply.PNG

 

The final step is to just have an Output tool which references the new Directory field. 

When configuring the tool just select "Take File/Table Name From Field" & "Change Entire File Path".

Directory_reply2.PNG

 

Hope this helps,

 Josh

Labels