We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Need help to crate workflow to merger .txt files

swaroopmg
5 - Atom

can you pls help me to create a workflow where i wanted to merge a .txt file which are saved in one folder where numbers of columns are different for every file.  

6 REPLIES 6
abacon
12 - Quasar

@swaroopmg You are going to need to give more context for this.

 

There is a way to do this - but are these saved as .txt files but are all delimited files delimited by the same character? Or are these .txt files with various formats that need to be parsed separately?

 

If they are delimited by the same character, then this is much easier. The other option is much trickier, especially with not context or information as to how they are formatted.

 

Bacon

OTrieger
14 - Magnetar

@swaroopmg 
There are different ways how to do it however your answer is too generic, we will need to have some more insights about the data in the txt files. Does they have the same headers, are all files using the same delimiter? 

How the data should merge? Do you the same data in the different files, such as invoice number, etc and then all the data for one invoice should be on the same raw or just stack up the data?

What are you 

swaroopmg
5 - Atom

These files are  delimited by the same character and however it just that number of columns and sequence are different. kidnly please suggest steps to do this in Alteryx   

swaroopmg
5 - Atom

These files are  delimited by the same character and however it just that number of columns and sequence are different. kidnly please suggest steps to do this in Alteryx

OTrieger
14 - Magnetar

Ok, will the txt files will always be in the same folder, or the input folder will change from time to time?

 

If you have static folder, then you can use FileBrowse tool. Set the FileBrowse tool to handle one file correct and then replace the file name with *. So you will have somthing like \nnnn\lkl\joi\mjb\*.txt. 

 

When you will run the automation Alteryx will import all the txt files in this folder and will merge the data. If you need a specific order of the headers you can arrange them with a Select tool.

 

If the files will be each time in a different folder, then you can use a batch macro the set the path and then configure it as above.

Gaurav_Dhama_
12 - Quasar

There is a workflow attached in this thread in my reply, see if that helps with your requirement.

Labels
Top Solution Authors