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

Iterate through files and save them separately

mat_ste_cb
8 - Asteroid

Hi again,

 

I've create a workflow that I want to repeat for all files in folder (I attach sample of 2 files). Batch macro join all input files, which is not my goal - I want to save every file separately (ideally would be keep the input file name for output file name). Is there a way to do it? 

 

Help much appreciated!

4 REPLIES 4
DavidP
17 - Castor
17 - Castor

I've amended your workflow slightly by extracting the input file path, modifying it and then adding it to the output as the filename and path to use for writing the output file. You'll have to change the formula to create the path you want.

 

If you wrap this in a macro and keep the output data tool in the macro, it will write an separate file for each input file.

 

update output path.png

 

 

mat_ste_cb
8 - Asteroid

Thanks a lot, your idea works! Nevertheless, the workflow works for one file,  when I build macro, an error appears:  "Tool #15: You must specify a sheet name" (for all files). I'm completely stucked on it. Thanks a lot in advance!

 

This is my batch macro:

image.png

This is my workflow using above macro: (Full path is chosen)

image.png

DavidP
17 - Castor
17 - Castor

You're pretty close. The fullpath that you use as control input for your macro needs to include the sheetname, which you can easily add with a formula tool.

 

I've simplified the macro a bit as you can output the fullpath from the input tool, so no need for the Append fields tool.

 

Sheetname.png

mat_ste_cb
8 - Asteroid

Thanks a lot, so simple, so brilliant! You really improved my work! 

Labels