community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Import Multiple Folders with One Directory Tool?

Quasar

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?

 

 

Highlighted
Alteryx Certified Partner

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

 

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

 

 

Quasar

@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?

Meteor

@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

Asteroid

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

Meteor

@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