I have found a way, but that works only for one single table - that is the problem: We are loading six tables with an asterisk in the FROM part (only one LOAD statement). With several separate LOADs, of course it would be feasible, but we just abandoned that approach.
For just one table, I can do the following:
- FIRST 1 LOAD from that Excel file without headers ("no labels")
- Create a variable with PEEK that has the name of one field (so, one variable for each field)
- LOAD once more ("embedded labels" from the Excel file, using the variables as fieldnames.
<=> That won't work with our "asterisk_LOAD" - or will it?
- That kind of LOAD concatenates all the tables, doesn't it? Well, that's where it breaks as the fields are supposed to be the same.
<=> Can't we replace that "asterisk_LOAD" with some kind of LOOP that will just load all of the files that are there?
P.S.: One possibility would be to use FILENAME to query the name of the file and execute the "asterisk-LOAD" for all the other tables where the fieldname is always the same and then do one more LOAD for this particular file.
<=> That is still two LOAD commands. Can't we do it in one (or in a LOOP)?
that's just perfect!
I had the same solution, slightly more complicated - I was loading the top_row only, generating one variable each for the fieldnames and then loading the entire table, using the variables as fieldnames - but I missed that REMOVE option, so the second load would return me the fieldname as a value...
Your option, however, means I can do it in just one load.
Thanks a lot!