# How to read multiple excel files in a folder and multiple sheets in an excel file?

**URL:** <https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723>\
**Category:** KNIME Analytics Platform\
**Created:** [April 11, 2018, 5:51am UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723 "2018-04-11T05:51:17Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nagaraja\_Ganiga](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/n/7c8e57/32.png) [@Nagaraja\_Ganiga](https://forum.knime.com/u/Nagaraja_Ganiga)\
**Post date:** [April 11, 2018, 5:51am UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/1 "2018-04-11T05:51:17Z")

</div>

Hi,

I need to read multiple sheets of same format of an excel file and combine them into a single table.

Also I need to read multiple excel files of a folder and combine them.

Thanks

---

<div class="post-metadata">

**Author:** ![Iris](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iris/32/14_2.png) [@Iris](https://forum.knime.com/u/Iris)\
**Post date:** [April 11, 2018, 6:05am UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/2 "2018-04-11T06:05:35Z")

</div>

Hi Nagaraja,

you can find this here: [https://www.knime.com/nodeguide/data-access/common-type-files/reading-excel-files](https://www.knime.com/nodeguide/data-access/common-type-files/reading-excel-files)

Best, Iris

---

<div class="post-metadata">

**Author:** ![pawanmtm](https://forum-cdn.knime.com/user_avatar/forum.knime.com/pawanmtm/32/6411_2.png) [@pawanmtm](https://forum.knime.com/u/pawanmtm)\
**Post date:** [January 19, 2019, 2:59pm UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/3 "2019-01-19T14:59:54Z")

</div>

Hi Iris,

I am trying to read/consolidate data from multiple sheets and files in a folder. I have created the same workflow as given in the link shared by you. I was not successful in getting the desired output.

I am not sure where i am missing.

I have attached the workflow and the files for the reference.

It would be very helpful if anyone can assist me on this.

Regards,  
Pavan.[Test.knwf](https://forum-cdn.knime.com/uploads/default/original/2X/b/b2ced473d4a4d626f07d7e6a4d5754f68fabb7f6.knwf) (16.1 KB)

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [January 19, 2019, 5:15pm UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/5 "2019-01-19T17:15:01Z")

</div>

You could give this a try. Or you might upload the excel files you want to import so we could see what is going on.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/0/086e2ca01e7a29e159c8cb619ec557008aa6e764.png)

[kn\_example\_multiple\_excel\_sheets.knar](https://forum-cdn.knime.com/uploads/default/original/2X/2/2885330d0264360dff2e82532f37f55cf025ae43.knar) (73.6 KB)

---

<div class="post-metadata">

**Author:** ![pawanmtm](https://forum-cdn.knime.com/user_avatar/forum.knime.com/pawanmtm/32/6411_2.png) [@pawanmtm](https://forum.knime.com/u/pawanmtm)\
**Post date:** [January 20, 2019, 12:43pm UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/6 "2019-01-20T12:43:42Z")

</div>

Hi mlauber71,  
I am unable to use the knime workflow shared by you due to version conflict. I am uploading the files for your reference. Could you please look into my workflow and let me know where i am missing.

[test1.xlsx](https://forum-cdn.knime.com/uploads/default/original/2X/3/32e5563d4fc4840f07b00cdf34ddfddea38673d1.xlsx) (19.0 KB)  
[test2.xlsx](https://forum-cdn.knime.com/uploads/default/original/2X/3/30dd571e2caa31b164bf49341902dfc3dd822e32.xlsx) (15.3 KB)

Regards,  
Pavan.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [January 20, 2019, 12:49pm UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/7 "2019-01-20T12:49:35Z")

</div>

All three of your sheets have different structures. Question is what do you want to do. If you want to consolidate them into one database you might have to come up with a rule which columns you want to keep and implement that, or you might have to have a rule which Sheets you want to consolidate.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/7/70f26d60aa77ae0916f23887d993bb519adf1789.jpeg)

---

<div class="post-metadata">

**Author:** ![pawanmtm](https://forum-cdn.knime.com/user_avatar/forum.knime.com/pawanmtm/32/6411_2.png) [@pawanmtm](https://forum.knime.com/u/pawanmtm)\
**Post date:** [January 20, 2019, 2:35pm UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/8 "2019-01-20T14:35:40Z")

</div>

Hi mlauber71,

my requirement is to consolidate all the data in all the sheets and files irrespective of different structures and then take only required columns.

As per my understanding that might be the easy thing to work on. Please let me know if you have better solution for this.

Regards,  
Pavan.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [January 20, 2019, 10:02pm UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/9 "2019-01-20T22:02:13Z")

</div>

Yes that is also possible. You can just tell the loop end to accept all kinds of Columns and data. You will then have to sort them out later. I have added a function where you store the source of you data since that might play a role.

The whole structure then is somewhat messy.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/2/26a75588135c6aa59c7f60a6d84dd60b77b4cf7f.png)

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/1/1b1a1af1d720406f2e67af6cd2f3d1fb8c8e770c.png)

[kn\_example\_multiple\_excel\_sheets2.knar](https://forum-cdn.knime.com/uploads/default/original/2X/c/cda286884e2d6bfcb0f472572cb99aad594eb003.knar) (106.3 KB)

---

<div class="post-metadata">

**Author:** ![pawanmtm](https://forum-cdn.knime.com/user_avatar/forum.knime.com/pawanmtm/32/6411_2.png) [@pawanmtm](https://forum.knime.com/u/pawanmtm)\
**Post date:** [January 21, 2019, 12:55pm UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/10 "2019-01-21T12:55:56Z")

</div>

I have changed the structure of the files to be same, since it is getting messy and complicated. Could someone assist on how to consolidate the data from all the sheets and files.

Attached the files and configuration screen shots for your reference.  
[test1.xlsx](https://forum-cdn.knime.com/uploads/default/original/2X/0/0788dc1e35eb9f49b3c9e888157ac580f9fd7d3a.xlsx) (18.9 KB)  
[test2.xlsx](https://forum-cdn.knime.com/uploads/default/original/2X/c/ceda02ac343815602cd02375c4e95857397d7b29.xlsx) (15.2 KB)

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/9/9e0959c4fff28ff46a44aab7a8e6386928f7611d.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/a/a2ed4fa987a6311f8b608551b73c8f90c7de62be.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/a/abe16ddd98ffe0e2dcab6277c2b038676ac70c4b.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/4/485115a2f083a83aa7454d2c3a9a4183decfc02d.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/7/7668686e34ace8f12175467129120618e3f5e760.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/3/379804ac3e5636ee4ec72f346ddfdee28a049677.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/5/52f60891cdc9e7aa64b71c72b076487eb6fc7e52.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/9/96ac2fdf5972f0dd5d6ff3afd915608d4d050f50.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/3/3e9a38814ae290aebbb4660657a6302d5c5c61f4.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/d/d08a4a27fab455f5cd7b576c981969f6ad426bbf.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/f/fdc2469153047699643d2f196bd4a44c420afd07.png)

Regards,  
Pavan.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [January 22, 2019, 6:35pm UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/11 "2019-01-22T18:35:41Z")

</div>

The structure still is not the same and either way you can use the example from before. You either collect all columns and do the restructuring later or you make sure every sheet has the same structure. If you know the columns are the same and just the names do differ you might omit the column names and add them later by reference.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/2/2dd682868e149b47ce14807caba207980d9da6d0.png)

---

<div class="post-metadata">

**Author:** ![pawanmtm](https://forum-cdn.knime.com/user_avatar/forum.knime.com/pawanmtm/32/6411_2.png) [@pawanmtm](https://forum.knime.com/u/pawanmtm)\
**Post date:** [January 23, 2019, 10:44am UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/12 "2019-01-23T10:44:00Z")

</div>

Hi mlauber71,

Yes you are right, the data in the columns are same, but the header names are different.  
So i have unchecked the column names box while configuring the excel reader node and it worked.  
I just can’t believe that i have missed on this small logic.

Here is the screen shot of the configuration change i have made (highlighted in yellow) for just reference.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/7/718b42243bb38dd082f9e51e2da31dcfee5eb241.png)

Thank you for your support in getting the expected output/result.

Regards,  
Pavan.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:29pm UTC](https://forum.knime.com/t/how-to-read-multiple-excel-files-in-a-folder-and-multiple-sheets-in-an-excel-file/10723/13 "2023-06-23T20:29:10Z")

</div>


