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

Alteryx Designer Desktop Discussions

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

Apply header from one file to another data file

Skyrone
7 - Meteor

Hi everyone,

 

I've been looking in the discussions about that particular need but couldn't find the answer to my question.

 

Here's my struggle. I've got two files :

- File1 : my data

- File2 : the header description of my data

 

I'd like to find a method to automatically apply headers from File2 to File1.

 

Here's an example of File1 :

Field_StringField_DateField_Int
Helloworld36526123
Toto44198456

 

And of File2 (I have it in delimited file, every columns has a length of 30 characters but I adapt it this way) :

FieldnameLengthDatatypeOthers infos…
Field_String000020CHAR 
Field_Date000008DATE 
Field_Int000005INT 

 

Obviously, the metadata obtained with Basic Data Profile on File1 should look like what I have in File2, but that's not entirely the case (especially for date columns).

Do you know a way to do it?

 

Thank you for your help! 

10 REPLIES 10
afv2688
16 - Nebula
16 - Nebula

Hello @Skyrone ,

 

Check out this example I created a while ago.

 

It uses a txt to read flat files and changes the length, data type and column names based on the input of a second file.

 

This is done by updating the xml directly

 

Check it and let me know your thoughts

 

Regards

Skyrone
7 - Meteor

Hi there,

 

Thank your for you quick answer. Unfortunately, I don't have the same Alteryx version as you (2019.3), and cannot update it right now. 

 

Can you send elements separately maybe ? 


Thank you again :- )

afv2688
16 - Nebula
16 - Nebula

Here you go,

 

Regards

Skyrone
7 - Meteor

Hi back,

 

Thanks for the share. I've been trying to use it for the last hour but can't manage to apply it to my files.

The big difference it that I have a csv input file instead of a txt.

 

I believe the main difference is in the macro FFI.yxmc, but I can't find what to change.

 

Do you have any ideas ? 

 

Thanks in advance.

afv2688
16 - Nebula
16 - Nebula

Hello @Skyrone ,

 

Could you share dummy files with the examples? Just to be sure about how data comes in.

 

Regards

Skyrone
7 - Meteor

Hi,

 

Sorry about the late answer.

Here's the two file that I use in my case.

 

Thank you !

afv2688
16 - Nebula
16 - Nebula

Hello @Skyrone 

 

How about this then?

 

Regards

Skyrone
7 - Meteor

Hi,

 

Again, could you kindly send elements separated ? I cannot import the .yxzp with my 2019.3 version of Alteryx.

 

Thank you so much !!

afv2688
16 - Nebula
16 - Nebula

Here you go

 

Regards

Labels
Top Solution Authors