Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Copy (duplicate) an Excel file to different location, overwriting one sheet

Wixard
アステロイド

 

Hi all,

 

Hoping there is an easy way to do this - seems straightforward, but couldn't quite get what I needed in the forums.

 

I have an excel file with 10 sheets (tabs) - the input file

 

I have created a workflow to bring in and modify one of these sheets only. 

 

I need to do the following:

 

1. Copy over the input file into a different folder - all the data should stay the same, including sheet names, file name etc, 

2. Overwrite the one tab from my Alteryx workflow that I have changed into this newly created copy - the sheet name remains the same

 

Any ideas?

 

Many thanks!

7件の返信7
fardeen9983
アステロイド

Instead of creating a copy of the excel sheet at the very beginning, you could have the modified output to a new excel sheet. That been the case. That being the case, are you importing all the sheets or only the one you wish to modify?

dougperez
クエーサー

I created this workflow to do this

First you have to do a batch to copy the files and put into events to "Before run" (the command that I created:

"@echo off
copy C:\Users\DouglasPerez\Downloads\Pasta\1\Book2.xlsx C:\Users\DouglasPerez\Downloads\Pasta\2\Book2.xlsx"

)

Then the workflow will update the sheet!

Wixard
アステロイド

Hi both,

 

Thanks for the replies!

 

I want to basically duplicate the input excel file with all its 10 tabs into a different folder location, then just modify a single tab based on the existing workflow.

 

What is a batch to copy the files? Is that a workflow tool?

dougperez
クエーサー

The batch is a .bat file, you have to create it with the parameters:

copy <current full path> <new path>

(if you dont know what a bat file is: https://en.wikipedia.org/wiki/Batch_file)

And save into a ,bat file, then use the events tab:

dougperez_0-1625668541303.png

 

This will copy the excel to another folder before the workflow run

 

dougperez
クエーサー

This workflow will create the batch and execute, then it will continue to add the new collumn

Wixard
アステロイド

Hi Doug,

 

Thanks a lot for the reply and the workflow. 

 

Is this really the easiest way? There is no other way in Alteryx just to copy and paste the same excel file with all its tabs to a new folder without running a batch file?

dougperez
クエーサー

You can make a macro to do this, but it will use a bat file...
Another solution is to read all the sheets and then create a new file on the new folder, I would do a Interactive macro with dynamic input in this case (but is a hardest one)

ラベル