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

Macro to iterate through files in a directory

nbt1032
8 - Asteroid

I have a series of Hierarchal XML files in a directory.  When I try to process these files using the Directory and Dynamic Input tool, I am running out of memory - I have this as an open issue with Alteryx - this method is off the table for  now.

 

As a workaround, I would like to iterate through each file in the directory, processing them one at a time. 

 

I am a experienced developer, but new to Alteryx. 

 

I would like to have a source workflow that creates a list of files.  I then want it to read each file and pass a data stream to a macro file for processing.  That macro will then pass back a result stream.  The base function can then do final processiing on this.

 

Can anyone provide me some high level strategies for performing this?  My first question is how to iterate through each file? 

 

Thanks,

Marc.

 

10 REPLIES 10
wellis
6 - Meteoroid

Hi, thank you for your example workflow and macro.

 

I used it as a model for my situation (a control table containing one row for each customer - including a filepath field and several other fields). I can successfully loop thru the companies and read each file using your technique. However, I also want to access other fields in the control table - say, company abbreviation, which I want to use in a formula to include in the output along with other info from each file. Not sure how. Thanks for any thoughts. 

Labels