Start Free Trial

Alteryx Designer Desktop Discussions

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

Retrieve txtfile with different header position

kathbanc
8 - Asteroid

Hello everyone, 

 

I need help! I have over 50 CSV files extracted from SAP. The column names are fixed, but the header column positions start on different lines.  The first file header starts with line 12, other starts with line 14, and so on. 

 

Need help to retrieve the 50 csv file and consolidate into 1 file. 

 

 

Thank you in advance. 

 

 

 

7 REPLIES 7
caltang
17 - Castor
17 - Castor

Load some sample data and we can help. No need for the whole dataset, just some sample from your own end, like 3 files. I can show how after.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
kathbanc
8 - Asteroid

Hello! thank you replying!

 

These are the sample file.

as you can see, the first file start with line 12

kathbanc_0-1752495869666.png

and  the other file starts with line 13 

 

kathbanc_1-1752495935268.png

 

Since they have different line  number , i am getting this error : 

 

kathbanc_2-1752496001141.png

 

 

caltang
17 - Castor
17 - Castor

The key is with the configurations of your input:

 

image.png

 

Of course, the rest is up to you to play with. I just did it in a way so your start point is easier to play with.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
kathbanc
8 - Asteroid

Thank you for your suggestion @caltang , was able to parse the column using the field 1

kathbanc_1-1752508939033.png

but i got new problem,  multiple text files where the same column (like "Shipping") appears in different positions across files (e.g., 3rd column in one file, 5th column in another). Resulting in incorrect data alignment :( 

 

kathbanc_2-1752509056368.png

caltang
17 - Castor
17 - Castor

You’ll need to make a macro for that then! Align one file then make it a batch macro. Feed the txt file paths and it’ll align accordingly. 

if you are stuck, show me how the data should look like and I can make something.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
kathbanc
8 - Asteroid

Hello! I try to search for macro , but it does not work for me T_T 

the alignment of column start with SAP carrie 

kathbanc_0-1752666743527.png

 

caltang
17 - Castor
17 - Castor

I don't get it @kathbanc 

 

From ZV14_v1.txt, show me how it should look in Excel. Do it once manually with each column name and its respective value, then we can help better.

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