李恒道 发表于 2021-5-18 19:48:20

python进行excel多薄合并

```
from openpyxl import load_workbook

# 打开一个workbook
wb = load_workbook(filename=r"C:\Users\test.xlsx")
file_handle=open(r'C:\Users\1.txt',mode='w')

writetext=''
for itemname in wb.sheetnames:
    ws = wb
    rows = ws.rows
    columns = ws.columns
    for row in rows:
      line = ''.join()
      print(line )
      writetext+=line+'\n'
      print(line)
file_handle.write(writetext)
file_handle.close()
```

hysaoh 发表于 2021-5-18 22:47:03

牛蛙,道总
页: [1]
查看完整版本: python进行excel多薄合并