xls_to_xlsx.py 627 B

123456789101112131415161718
  1. '''Created Mar 7, 2022 Levi'''
  2. import os
  3. import shutil
  4. from xls2xlsx import XLS2XLSX
  5. # src = '//mozaiq/levente.marton/#cnta/backup/Facturi/Facturi_Mol/EXCEL/'
  6. src = 'c:/Users/levi/Downloads/office/excel/fan/'
  7. # dst = '//mozaiq/levente.marton/#cnta/backup/Facturi/Facturi_Mol/EXCEL/xlsx'
  8. dst = 'c:/Users/levi/Downloads/office/excel/fan/xlsx'
  9. files = filter(lambda f: f.endswith('.xls'), os.listdir(src))
  10. for file in files:
  11. # shutil.copy2(os.path.join(src, file), os.path.join(dst, file.replace('xls', 'xlsx')))
  12. x2x = XLS2XLSX(os.path.join(src, file))
  13. x2x.to_xlsx(os.path.join(dst, file.replace('xls', 'xlsx')))