# Excel Reader - How to retain empty cells?

**URL:** <https://forum.knime.com/t/excel-reader-how-to-retain-empty-cells/61674>\
**Category:** KNIME Analytics Platform\
**Tags:** excel\
**Created:** [February 13, 2023, 10:08pm UTC](https://forum.knime.com/t/excel-reader-how-to-retain-empty-cells/61674 "2023-02-13T22:08:06Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![iCFO](https://forum-cdn.knime.com/user_avatar/forum.knime.com/icfo/32/36036_2.png) [@iCFO](https://forum.knime.com/u/iCFO)\
**Post date:** [February 14, 2023, 9:31pm UTC](https://forum.knime.com/t/excel-reader-how-to-retain-empty-cells/61674/22 "2023-02-14T21:31:07Z")

</div>

My guess is that when it broke the export into 2 files, it didn’t properly recreate the filters in one of the files. You will notice that data 27 lacks the filter controls at the column header which are present on data 28.

---

<div class="post-metadata">

**Author:** ![LB\_Knime](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/aca169/32.png) [@LB\_Knime](https://forum.knime.com/u/LB_Knime)\
**Post date:** [February 14, 2023, 9:40pm UTC](https://forum.knime.com/t/excel-reader-how-to-retain-empty-cells/61674/23 "2023-02-14T21:40:27Z")

</div>

Something like that - but, in fact, the two files are manually created rather than auto-split by a single export. I’m going to find out how that was set up (wasn’t me).

---

<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:** [February 15, 2023, 4:09pm UTC](https://forum.knime.com/t/excel-reader-how-to-retain-empty-cells/61674/24 "2023-02-15T16:09:37Z")

</div>

@LB_Knime the OpenPyxl is quite easy to use in case someone sees this thread in the future. It basically works like this:

```auto
import knime.scripting.io as knio
import pandas as pd

v_excel_file = knio.flow_variables['file_path']
v_name_sheet = knio.flow_variables['Name_Excel_sheet']

df = pd.read_excel(v_excel_file, sheet_name=v_name_sheet, engine='openpyxl')

knio.output_tables[0] = knio.Table.from_pandas(df)

```

> **[Import Excel File with OpenPyxl (simple) – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_python_excel_import_simple_file_openpyxl~gtHNLTIhu-uTNuDa)**
>
> Import Excel File with OpenPyxl (simple)

---

<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:** [February 22, 2023, 4:10pm UTC](https://forum.knime.com/t/excel-reader-how-to-retain-empty-cells/61674/25 "2023-02-22T16:10:15Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

[Previous page](https://forum.knime.com/t/excel-reader-how-to-retain-empty-cells/61674.md?page=1)
