read multiple excel file with different structure

Hi @alrz , this is going to get much depend on your files and just how different they are.

For example will the columns that are the same be in the same order?

Are the column names consistent?

Does the combination of all the excel sheets make sense to be in a single table?

Where there are differences in the files, what do you want the resultant table to look like?

Here is one topic with suggestions that may be of help:

Putting the Excel Reader in a loop may also be an option…generally for this, if you’re reading all the excel files from a folder, I’d use a List/Files and Folders node to feed paths to a Table Row to Variable Loop Start, then pass the path variable in that loop to an Excel Reader which passes to a Loop End, configured to “allow changing table specifications” and see if something comes out that is workable.

If you need to do column renaming because column names differ, there are various strategies. You could use the Column Rename (Dictionary) inside the loop like this, as one possibility

If you only have, say, three or four Excel files, and they are in a variety of locations, then using an Excel Reader for each, and then concatenating the outputs using the Concatenate Node (or the Table Manipulation node) may also be an option.

If you can give more detailed examples of how similar (and how different) the files are, then it would be easier to give better assistance.

4 Likes