# OdsIO clear cells

**URL:** https://discourse.julialang.org/t/odsio-clear-cells/122609
**Category:** General Usage
**Created:** [November 13, 2024, 10:32pm UTC](https://discourse.julialang.org/t/odsio-clear-cells/122609 "2024-11-13T22:32:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)
#### Post date: [November 13, 2024, 10:32pm UTC](https://discourse.julialang.org/t/odsio-clear-cells/122609/1 "2024-11-13T22:32:38Z")

</div>

Is there an OdsIO.jl command to clear cells?

It seems there is a [VBA solution for Excel](https://www.mrexcel.com/board/threads/vba-to-clear-cell-contents-and-conditional-formatting-but-retain-the-formula.1266092/)

And ezodf does seem to have a [clear command](https://pythonhosted.org/ezodf/genindex.html) but I can’t say I understand it.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [November 13, 2024, 10:57pm UTC](https://discourse.julialang.org/t/odsio-clear-cells/122609/2 "2024-11-13T22:57:36Z")

</div>

Also in case helping you thing package seems to have this for Excel files:

> **[Tutorial · XLSX.jl](https://felipenoris.github.io/XLSX.jl/stable/tutorial/#Edit-Existing-Files)**
>
> Documentation for XLSX.jl.

@sylvaticus  
It’s probably `set_value` function, by just setting an empy string.

But I’m not sure the Python wrapper supports//wraps it. [I DO, though, see it used once in the code.]

I would first look up how this is done in Python, i.e. if actually possible (with that package, it has extensive docs). Then see if Juli wraps if for sure.

If not you can us all of the functions of that package through PythonCall.jl, in case the Julia wrapper (that uses PyCall.jl) doesn’t. If it’s missing you may also add this or anything to the wrapper in a PR.

I suppose these something else:  
`clear`: [GenericWrapper Class — ezodf 0.3.0 documentation](https://pythonhosted.org/ezodf/base.html?highlight=clear#base.GenericWrapper.clear)

[https://pythonhosted.org/ezodf/tableobjects.html?highlight=delete#Table.delete\_columns](https://pythonhosted.org/ezodf/tableobjects.html?highlight=delete#Table.delete_columns)

I think the bare minimum is supported in the wrapper, like load into a DataFrame (where you could clear delete something I guess, and then), save such a Dataframe.

---

<div class="post-metadata">

### Author: ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)
#### Post date: [November 14, 2024, 8:37am UTC](https://discourse.julialang.org/t/odsio-clear-cells/122609/3 "2024-11-14T08:37:33Z")

</div>

Hi, OdsIO maintainer here. I’ll look on this if you are interested. “clear” in the sense of setting an empty string would be likelly the easiest solution, but it would be more a workaround than a real solution.  
For example, if the cell to “clear” is on the final column (or row) the properties of the spreadsheet would still include up to that column (or row), it isn’t really removed. But on the other hand, “clear” is not “delete”…

Let me know what you need more specifically…

---

<div class="post-metadata">

### Author: ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)
#### Post date: [November 14, 2024, 12:08pm UTC](https://discourse.julialang.org/t/odsio-clear-cells/122609/4 "2024-11-14T12:08:11Z")

</div>

At this point it is not essential, more a nice to have.

From the LibreOffice perspective, what I need is the function provided by the `Delete` key on the keyboard. So from the OdsIO side I would like to be able to write a matrix of `Delete`’s or specify an area to `Delete`.

Edit: `Delete` means it deletes the contents of the cell, but not the formatting, or other attributes of the cell, like what is allowed into the cell.

It may be possible to put in an empty string, but then I would have to mess with the logic of the spreadsheet, which I prefer not to do.
