In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Replicate a file multiple times, saving with different names

gzzaniol
5 - Atom

Hi,


I'm trying to replicate a file that is being used for one entity for multiple entities.

 

One of the sheets has a column with 35x rows for each entity. How can I loop through that sheet (or a list), but replicate the whole file for each of the names on that sheet/list.


My old VBA brain says something along the lines of: for i = 1 to 49, duplicate whole file, save as i.xlsx. Is it something easy to put together?!

Thanks in advance.

8 REPLIES 8
Emil_Kos
17 - Castor
17 - Castor

Hi @gzzaniol,

 

You can check this article on how to copy/move files with alteryx: 

 

https://tarsolutions.co.uk/blog/move-or-copy-files-in-alteryx/

Maskell_Rascal
13 - Pulsar

Hi @gzzaniol 

 

Here is a mockup of how you can do it. 

 

I'm reading in the file I want to duplicate with the Directory Tool, Appending the list of file names to the set, generating the Script to be run, and the using the Run Command tool. 

 

Maskell_Rascal_0-1615409834319.png

 

Here is how I have my folders setup:

Maskell_Rascal_1-1615409941438.png

 

When ran successfully, this mockup will duplicate and rename the file 10 times in the Output Folder. 

Maskell_Rascal_2-1615410009054.png

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Thanks!

Phil

gzzaniol
5 - Atom

Thanks guys. I'll give it a shot later today and will keep you posted. Really appreciate the support of the community!

gzzaniol
5 - Atom

Thanks. It worked nicely and saved me a couple hours. 

Really appreciate it.


Best,

GZ

tsingh4
7 - Meteor

Hi Maskell

 

When i ruin your code, it shows the error 1 at the run command, could you suggest why it is showing that

Maskell_Rascal
13 - Pulsar

@tsingh4 - Can you share a screenshot of the error and how you have the run command configured?

Ostap002
6 - Meteoroid

Hi Maskell,

 

It runs like that:

Ostap002_0-1667292360120.png

But if you try it in the other files it work properly.

Thank you so much for your solution!

 

mmarshallbdtcap1
5 - Atom

Amazing! Thank you for sharing this.

 

Labels
Top Solution Authors