cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Iterate through files and save them separately

Highlighted
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!

Bolide

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

 

 

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

Bolide

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

Asteroid

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

Labels