You can do a CrossTable Load to convert your list of columns into a single column with multiple rows:
LOAD 1 as Flag,
DROP Table Table1;
Now Columns field will include all the column names that are available in your Excel file.
Ending up with Columns null again - as I did with FileName... lets try the question this way instead.
What I want to achieve is some way of dynamically pick column names based on what the excel file contains and save those into a field.
(in a batch of many excel-files that are similar but not exact)
file 1 contains
file 2 contains
file 3 does not contain any of those
in my imported data i would like to have the result
State as State (from file 1)
Stat as State (from file 2)
"N/A" or just blank as State (from file 3)