Hello,
I'm trying to perform column header name check on 12 excel files using Alteryx Designer. How do I do that?
The point of this check is to identify if any of those 12 excel are missing certain columns.
Thank you very much
Sarah
Hi @Decembersnowflake ,
How I would do it is through a batch macro.
Assuming that all your 14 files are within the same folder, use a directory tool to get the full path for each one of your 14 files.
Then you need a batch macro to read through all 14 different files and look for the fields within each one of those files. To do the latter, you need to use a field info tool, which will return the name of the fields in each file.
The reason you need a batch macro, is because you expect the field names/numbers to be different in each file, so those files will have a different schema. To read multiple files with different schema, you need a batch macro.
Your batch macro will look like this:
So what happens here is, for each file in the folder defined by the directory tool, this workflow shown above will run, reading each one of those 14 files and outputting the field names at the end across with the source, so from which one of those 14 files those field names are coming from.
I've mocked up 4 excel sheets with different number of columns (from A-E). At the end of the workflow, I can see that file 4 misses column B and file2 is missing column E
Conscious that if you are not familiar with batch macros, that can seem a bit complicated, so feel free to ask any questions.
Hope that helps.
Regards,
Angelos