How to extract sheet from *.xlsm and save it as *.csv in Python?

前端 未结 3 1633
悲&欢浪女
悲&欢浪女 2021-01-05 11:03

I have a *.xlsm file which has 20 sheets in it. I want to save few sheets as *.csv (formatting loss is fine) individually. Already tried xlrd-xlwt and win32com libraries b

3条回答
  •  有刺的猬
    2021-01-05 11:36

    import pandas as pd
    
    # YOU MUST PUT sheet_name=None 
    df = pd.read_excel('YourFile.xlsm', sheet_name=None)
    
    # prints all sheets
    print(df)
    

提交回复
热议问题