Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Combining mutliple text files each with different number of columns but same delimiter

sai11
Météore

Hello alteryx community

I have multiple text files in a folder,

I am using wild character to bring in multiple text files but when i run, only 1 file data is outputed

if any one has idea please share

 

My approach:

Used dictionary to read the path

Given the full path to dynamic input tool

 

Expected output 

Is a single file 

4 RÉPONSES 4
ChrisTX
Nébuleuse

Just like Excel files, if your input files are not the same format, you cannot use a Dynamic Input tool.

 

Check out this knowledge base article:

 

The Ultimate Input Data Flowchart
Community > Designer > Designer Knowledge > The Ultimate Input Data Flowchart
https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/The-Ultimate-Input-Data-Flowchart/t...

 

You could import each file as one field, one long string.  But a batch macro would likely be easier.

 

Chris

Luke_C
Castor

Agree with @ChrisTX 

 

A lot of this will depend on what you're ultimately trying to do. If you want the files read into one big table then batch macro is the way to go (you will probably have a lot of null values).

 

If these files all serve a different purpose, then set-up different input tools. 

oly
Alteryx Alumni (Retired)

Hi @sai11 ,

unfortunately, for the input tool with * or directory+dynamin input, the files formats have to be totally identical. So you have two choices:

 

1. Import all the files as is separately with individual input tool and then combining them with Union tool. When you use this approach, I personally recommend to have first a dummy file with all of the columns in the correct order. Otherwise Union tool will add columns as it encounters them. Hence I created Text0 file for you that you can remove records later after Union tool.

 

2. Modify the files original algorythm to save them always with the same list of columns. Were the files produced by another Alteryx workflow?

 

Sample workflow attached just to confirm the test.

 

Thanks,

Oly 

binuacs
Polaris

@sai11 one way of doing this with the batch macro as @ChrisTX suggested

binuacs_0-1656453616807.png

 

Étiquettes