Is it possible to sort a column within a .xlsx file using Python's 'xlswriter' module? Here is some sample code:
import xlsxwriter
wb = xlsxwriter.Workbook('test.xlsx')
ws = wb.add_worksheet()
data = (
['Region', 'SalesRep', 'Product', 'Units'],
['East', 'Tom', 'Apple', 6380],
['West', 'Fred', 'Grape', 5619],
['North', 'Amy', 'Pear', 4565],
['South', 'Sal', 'Banana', 5323],
['South', 'Hector', 'Apple', 9814]
)
for row in range(len(data)):
ws.write_row(row,0, data[row])
ws.filter_column(2, <?????>)
Alternative solution
I speculate you want to apply a filter to a known column of the working workbook. This solution will add the filter but the sorting can only take place at runtime as a feature of the MS Excel.
For your convenience: