How to read multiple excel files in one folder?

Hi, I want to use below knime flow to read 2 excels in one folder and combine them into 1 speed sheet in a new excel. the two input excel had same template and header. But when execution, there is always an error showing as below:

Execute failed: Input table's structure differs from reference (first iteration) table: Column 7 [Delivery Q (Number (integer))] vs. [Delivery Q (Number (double))]Column 9 [Gross Weig (Number (double))] vs. [Gross Weig (String)]

So, how can I change the table structure to ensure two tables have the same characters? thanks for your help!

Hey yjchen110,

I think that's about the type of the columns. You can use the Column Rename node as well as nodes such as String To Number (or better Number To String) to make the column types match. That should solve the problem.

If not, please don't hesitate to come back here. Maybe you could provide some sort of sample from your files which would allow me to give a more specific answer to your problem.

Best,
Ferry

1 Like

Hello All,

I have a Folder with xls files of similar format ( Each file has 3 tabs A, B & C ). I’m trying to combing the data from these files and to export as a Master file. ( No sheet merging. The master should have tabs A, B & C)

Please check the following workflow in the image below.

I tried using a File Reader in my earlier posted workfow. Now I have a new Error. How can I resolve this.

image

image

Thank you,
Sid

1 Like

Hi Sid,

It is Excel limitation I think. Check this topic:

Br,
Ivan

Thank you Ivan,

I was able to read multiple excel files from a folder and export out as a master excel file. However, I only see the data from 1 tab got consolidated. My input files contains 3 different tabs ( A, B & C). Is there a way I can export all of that data consolidated into my master in the same format as my input ( with tabs A, B & C )

~Sid.

Use 3 loops by tabs and look on Excel Sheet Appender.

1 Like

Hi!

Yes you can. As @izaychik63 said you need to loop over tabs and use Excel Sheet Appender.

Br,
Ivan

Thanks @izaychik63 & @ipazin.

I played with the loop over tabs things a bit and ended up here. How can I join the 3 loop ends to Append ?

Is this what loops by tabs mean ? Thanks for your help

Thank you,
~Sid

If you already know that the collection of Excel Files all have sheets A, B, C there is no need to again read the sheets and loop over them. I would just loop across the Excel files themselves and have three flows that import the data. The regular Loop End node would Append the results. If you have changing structures you might have to modify the approach.

kn_example_excel_abc_sheets.knar (109.1 KB)

4 Likes

Thanks a lot Mlauber71. That really helped.

1 Like

How can we import multiple excel files in KNIME at one go?

Maybe you could adapt this workflow

1 Like

I tried this earlier also but it didn’t work, I’ll again explain my task, I’ve some files in my pc(they can be of any format excel or csv) and I need to import them into knime environment at one go instead of using Excel Reader(XLS) node again and again. I’m attaching 3 files here, please help me with the workflow that I can use. For the reference I’m taking example of 3 files but there can be hundred files since I’m very new to KNIME and wants to explore this as much I can.Data1.xlsx (15.3 KB)
Data2.xlsx (16.1 KB)
Data3.xlsx (15.8 KB)

You could take a look at this workflow. Not sure if there is a way to load Excel files in one step without loop. Only technique I could think of is an external Hive table referring to a folder of CSV files (have not yet tried that with KNIME) but that seems not to work with KNIME.

And another note. There seem to be some customer informations and names in the sheets. Maybe you want to check if you are 100% comfortable with sharing them.

kn_example_multiple_excel_sheets4.knar (136.3 KB)

2 Likes

Hi, how can we apply fuzzy in knime as the same fuzzy that we apply in SQL, like if I want to check the similarity between name or address or telephone numbers.

For eg: We have address column in two different files(one is employee_master and second is vendor_master) and I want to check the similarity % between these columns(in any)

First I think it would be best if you have a new question to open a new topic, makes it easier for people to find relevant information.

Then as has been mentioned here there seems to be just the workflow you need to compare Adresses. Maybe you could adapt that:

https://www.knime.com/knime-applications/address-deduplication

Also if you just want to calculate the similarity of strings there is this thread:

1 Like

Hi, I,m trying to import multiple excel files in knime using one workflow but getting error in one of the node, ii would be great if anyone can help me about the thing that I’m missing here.
I’ll attach all the files that I want to import along-with the picture of the workflow with the error.

Hi there!

What error are you getting? Do you manage te read at least one Excel file or you get error in first iteration?

Br,
Ivan

Hi Swatityagi,

can you try uncheck the first row header option while configuring the node.

Regards,
Pavan.