OpenPyXL + How can I search for content in a cell in Excel, and if the content matches the search criteria update the content?

吃可爱长大的小学妹 提交于 2019-11-28 01:43:14

The .value property of the Cell object is settable. This means that you can do any time something like:

cell.value = 'Helloooo ladies'

If this does not work it is probably because of the optimizer read mode. Check the optimized write mode if you needed... I always found the docs of openpyxl very complete and easy to follow.

How to look for information in the cell, or recognize what you are looking for is a very open question that can be solved in thousand different ways:

  • Checking the full content of the cell
  • Checking that a given substring is contained in the cell
  • Matching with a regular expression
  • ...

But this does not have anything to do with the openpyxl framework.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!