Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sorting Excel
#1
I'm making a small subprogram that takes an Excel workbook (100K cells at minimum, usually more), finds disordered columns and orders the columns. I've managed the part that identifies which column belongs to what product, but I'm stuck on sorting them. I'm using openpyxl to automate other parts of the workbook so I was bit surprised there isn't a sort function in the module. Are there other modules that could do the job or an easy way to do it without using a module?

Thanks.
Reply
#2
For openpyxl there is an indirect method, through filters: https://openpyxl.readthedocs.io/en/stable/filters.html
That's probably not what you're looking for.
If you switch to pandas, it's well defined: http://pandas.pydata.org/pandas-docs/ver....sort.html

Still, without switching, the only sure way that I can think of is to export to a csv file, sort that and then load results. A hack, but it should work.
Reply
#3
I want to get into pandas eventually, but I guess I could try the csv route first and see if I can make it work.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Data Sorting and filtering(From an Excel File) PY_ALM 0 1,012 Jan-09-2023, 08:14 PM
Last Post: PY_ALM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020