Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How to pick 7 files from folder with similar name except for date and union all?

Isha_Gupta
8 - Asteroid

I have 7 files in 1 folder.

Names are like.. abc 1/01/23, abc 2/01/23 abc 3/01/23 etc.

Dates I have added random but only that part is different.

 

I have to input and union all files.

 

Is there any quick way than to use input for each and then union?

4 REPLIES 4
alexnajm
17 - Castor
17 - Castor

If they are the same structure, you can use a wildcard and read them in as “abc *.csv”

gawa
16 - Nebula
16 - Nebula

Hi @Isha_Gupta 

 

Using wild card * would help. In this case, you can specify "abc *.csv".

If you want to make it clear which row comes from which csv file, specify option "Output File Name as Field" in Input tool configuration.

image.png

 

But, you need to keep in mind one thing. If some csv files have different schema(different field name, different number of fields) from others, those csv are ignored(see below warning message). In this case, you have to use Batch macro to forcibly read all files, which would be a bit complicated to configure. 

 

image.png

caltang
17 - Castor
17 - Castor

As above, you can use the wildcard * to call them all in assuming they are of the same structure. Alternatively, you can use the Directory Tool to call them in as well.

 

If they are of a different structure (different data types on same columns, additional columns, etc.) - you will need a Batch Macro to call them in.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels