Alteryx Designer Desktop Discussions

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

Help with Batch Macro for multiple TXT files w/differ schema

ELPC
8 - Asteroid

Hi all, 

I am trying to figure out how to create a batch macro to pull in all the TXT files from a particular directory.  The TXT files may have some of the same fields and others will have extra columns -  therefore different schema.  In the actual workflow, I am assuming I will use a Directory tool first, but I am not sure what to do after that.  Do I need a Dynamic Input tool after the Directory tool and then add the batch macro after the Dynamic Input?  I am not sure how to configure everything. If it is a TXT file, I'm assuming I don't need to define a "sheet" like an Excel file, correct?  If someone could refer to me to workflow with a connected batch macro that would be great.  I tried looking all around and a lot of the batch macros I have found are for Excel files and not TXT.  Thanks.  

6 REPLIES 6
ArtApa
Alteryx
Alteryx
ELPC
8 - Asteroid

Thanks, I will take a look but again, it is an example based upon Excel files that require a sheet name.  I am uncertain if I need to include a sheet name in the fullpath for the batch macro for a TXT file.  Do you know?  I have created a batch macro for Excel files before that worked but I just can't get it to work for TXT files. That is why I'm asking if someone can direct me to a specific example for TXT files.  

Qiu
20 - Arcturus
20 - Arcturus

@ELPC 
I think we need to know your delimiter used in all your text files.

A few samples would be better.

ELPC
8 - Asteroid

Hi, the TXT files are comma delimited.  Unfortunately, these are not my files so I let me try to mask the data to provide some sample files. 

ELPC
8 - Asteroid

This is what I have so far: 

ELPC_0-1646786071664.png

This is what is coming out of the formula tool: 

ELPC_1-1646786114204.png

 

This is what the macro looks like: 

ELPC_2-1646786172371.pngELPC_3-1646786194450.png

ELPC_4-1646786213287.png

 

I'm still getting this error:  I'm not sure where I am going wrong.  

ELPC_5-1646786292381.png

 

 

275397
5 - Atom

Hi, I too am running into same issue. Were you able to solve for this problem? If yes, could you share your solution? TIA

Labels