Alteryx Designer Desktop Discussions

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

Reading multiples csv files with differents columns orders

ByranCarter12
7 - Meteor

Hi everyone,

 

I am dealing with an issue about concatenate multiples csv files. 

 

So I'am using, the Directory Tool to get all directory for each files and then I'm using the Dynamic Input to read all Files.

 

I have voluntarily uncheck the headers columns options because I wanted to check if there are sames columns for each files. So i need to have the headers for each files.

 

Finally, I noticed that there are columns not in the same orders, I give you this example to understand :

 

Fields 1Fields 2Fields 3Fields 4Fields 5Fields 6Fields 7Fields 8Fields 9Fields 10
IdNameCityPostcodeCountryAreaGPS 1GPS 2SalesPrice
1JohnLondonC2N 5DUUK1,57210,512,67210
2MarkBoston2500USA25002,553,7815615
3PaulNY6800USA35001,653,255142
4MikeMadrid4890MSP140015,2548613,155823805
5JudithMilan8996IT150010,00211,2589660
IdNameCityPostcodeAreaCountryGPS 1SalesGPS2Price
15ParkerManchesterCT4 369 UK15,14815,6994368
13JenniferChicago4500 USA12,13714,255323
14JohnDallas2690 USA10,31213,02254465
12DavidTexas4560 USA14,99669112,02221764
11PeterBarcelona4590B SP12,25557210,2552916
8SamanthaTokyo10266 JP10,5555811,02255

798

 

 

So I don't know how to organize the columns. I tried to use the Transpose Tool, but I did not succeed.

I don't know if it's possible to concatenate each file step by step by ordering the right columns together ?

 

Thank you for your help.

 

1 REPLY 1
messi007
15 - Aurora
15 - Aurora

@ByranCarter12,

 

You can use a Batch macro in order to that,

 

1- Create a batch macro to read a CSV file

 

messi007_0-1616083033753.png

2- Select the option below from the interface designer

 

messi007_1-1616083074849.png

3- Use an input directory to read all the files

 

messi007_2-1616083121489.png

Attached the packaged workflow,

 

If this help please mark it as solved it will help others 🙂

 

Best Regards,

Labels