简体   繁体   English

使用 python 删除所有隐藏行

[英]Delete all hidden rows using python

There are some hidden rows in my xlsx file.我的 xlsx 文件中有一些隐藏的行。 I want to remove them using python.我想使用 python 删除它们。 Is there any python solution?有没有 python 解决方案? 床单

You can make use of openpyxl library in python.您可以使用 python 中的openpyxl库。 The workbook loaded via this library has a hidden property available in the Row Dimension of the workbook ( https://openpyxl.readthedocs.io/en/stable/_modules/openpyxl/worksheet/dimensions.html?highlight=hidden )通过此库加载的工作簿在工作簿的行维度中有一个可用的隐藏属性( https://openpyxl.readthedocs.io/en/stable/_modules/openpyxl/worksheet/dimensions.html?highlight=hid

You can iterate over the rows and exclude rows which have hidden property set to true and create a new excel with the non-hidden rows.您可以遍历行并排除隐藏属性设置为 true 的行,并使用非隐藏行创建一个新的 excel。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM