Alteryx Designer Desktop Discussions

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

Repeat - Append CVS Files Workflow - Folder by Folder - on All Folders in Subdirectory

Aakash55
7 - Meteor

I have searched the community and have found the examples of how to append all the CSV files in a single folder, or even CSV files present inside all the subfolders.

 

But my requirement is different and I have not been able to find out any examples yet.


This workflow example is for - Appending all CSV files, which are present inside a folder, into a single csv file. And how to repeat this process for all the sub folders that are present inside the parent folder.

 

I have to run this workflow on csv data files, which are quite large in size.

and I have to run this flow onto hundreds of such csv files present within the same folder and then repeat the same for the next folder and so on.

 

The good news is that all these files have the exact same structure and format and a constant schema throughout.

All csv files are located in this same folder - "C:\Data\Batch Macro\Append CSV\Data Input Directory".
The sub folders are named according to the dates in "YYYYMMDD" format for "Year Month Date" like "20230122" for the date of 22 Jan 2023 and so on.

 

To make it easy for you, I have attached the sample csv files , on which this workflow needs to be run.

Although the actual data files are quite big, having millions of rows in it, but I have made a very small sample out of it for sharing here.
All this data has a constant schema throughout, having same number of fields and same type of data.

 

Please have a look at the attached sample csv data files first.

Then the final output for this Batch Macro, based on attached sample data would give the output in the form of 3 Big Size CSV Files, like this -

20210426.csv - which will have all the data from these 3 csv files - a.csv, b.csv, c.csv present within that folder.

20210427.csv - which will have all the data from these 3 csv files - x.csv, y.csv, z.csv present within that folder.

20210428.csv - which will have all the data from these 3 csv files - 1.csv, 2.csv, 3.csv present within that folder.

 

I have also attached the Alteryx Worflow Package .yxzp file, so that you can easily open it up on your machine. I have used the latest version of Alteryx for creating this workflow. You may please have a look.


Thanks a lot


PS: I am not being able to attach all the CSV files to this post. You may simply rename the attached CSV file as  x.csv, y.csv, z.csv and 1.csv, 2.csv, 3.csv to recreate the example at your end.

 

 

 

 

A.png

 

 

 

 

 

 

B.png

 

 

 

10 REPLIES 10
Aakash55
7 - Meteor

Thank you so much.

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels