I have a really large excel file and i need to delete about 20,000 rows, contingent on meeting a simple condition and excel won't let me delete such a complex range when using a filter. The condition is:
If the first column contains the value, X, then I need to be able to delete the entire row.
I'm trying to automate this using python and xlwt, but am not quite sure where to start. Seeking some code snippits to get me started... Grateful for any help that's out there!
Don't delete. Just copy what you need.
If you just need to delete the data (rather than 'getting rid of' the row, i.e. it shifts rows) you can try using my module, PyWorkbooks. You can get the most recent version here:
https://sourceforge.net/projects/pyworkbooks/
There is a pdf tutorial to guide you through how to use it. Happy coding!
I like using COM objects for this kind of fun:
I usually record snippets of Excel macros and glue them together with Python as I dislike Visual Basic :-D.
I have achieved this using Pandas package....
You can try using the csv reader:
http://docs.python.org/library/csv.html
You can use,
will delete rows 1 to 20,000 in an open Excel spreadsheet so,