I have this code;
from xlrd import open_workbook
import csv
wb = open_workbook('test.xlsm')
for i in range(2, wb.nsheets):
sheet = wb.sheet_by_index(i)
print (sheet.name)
with open("data/%s.csv" %(sheet.name.replace(" ","")), "w") as file:
writer = csv.writer(file, delimiter = ",")
print (sheet, sheet.name, sheet.ncols, sheet.nrows)
header = [cell.value for cell in sheet.row(0)]
writer.writerow(header)
for row_idx in range(1, sheet.nrows):
row = [int(cell.value) if isinstance(cell.value, float) else cell.value
for cell in sheet.row(row_idx)]
writer.writerow(row)
The code works fine however in the csv file I have excel date in multiple columns but the script converts everything as excel time, is there a way to specify that for columns A,D,F,E,G,H to convert the Excel date into normal mysql date?