Alteryx Designer Desktop Discussions

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

How to combine multiple files from one folder to multiple sheets in one file ?

JT0168
7 - Meteor

I have several files from one folder below example and wanted to consolidate them in one file under different sheet names corresponding to the file name. Is there a way to do this? The file name is changing every month based on the week.

 

ABC-2022-09-30.csv

ABC-2022-10-07.csv

ABC-2022-10-14.csv

ABC123-2022-0930.csv

ABC123-2022-10-07.csv

 

 

Thank you!

 

5 REPLIES 5
gautiergodard
13 - Pulsar

Hello @JT0168 

Yes, you could do something like this ! 

You'll just need to replace the folder paths in the input, formula and output tools to point to wherever your files are saved currently and wherever you want to save the combined workbook.

gautiergodard_0-1667325520374.png

 

Hope this helps!

 

IraWatt
17 - Castor
17 - Castor

Hey @JT0168,

Sure, this is possible.

First get all the paths to the CSV's using the directory tool:

IraWatt_1-1667325514626.png

Then use a dynamic input tool configured to also pass through the file name with the data for each file

IraWatt_0-1667325364467.png

 

 

 

 

 

 

 

 

 

 

 

 

 

In the dynamic input make sure to change the data source off the full path field:

IraWatt_2-1667325571920.png

Then use a formula to add on ||| to make the file name a sheet name:

IraWatt_3-1667325639023.png

Finally output the data using the output data tool changing the sheet name based on the sheet column we made:

IraWatt_4-1667325659907.png

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

 

 

 

 

JT0168
7 - Meteor

What if I need to combine those ABC123 in one sheet and the rest separate sheets in one file? Thank you!

 

ABC-2022-09-30.csv

ABC-2022-10-07.csv

ABC-2022-10-14.csv

ABC123-2022-0930.csv

ABC123-2022-10-07.csv

 

 

 

JT0168
7 - Meteor

No need to reply I got the answer...thank you!

gautiergodard
13 - Pulsar

@JT0168 my earlier reply could help you do this as well without the need for a dynamic input tool :)

Labels