2
디렉토리에있는 100 개의 Excel 통합 문서에서 특정 셀 값을 읽고 별도의 Excel 시트에 해당 데이터를 써야합니다. 다음은 내가 실수 한 오류입니다.여러 개의 Excel 파일을 하나의 디렉토리에 저장하고 특정 셀 값을 다른 Excel 시트에 작성
#!/usr/bin/env python
import os
import xlwt
import xlrd
index=0
workbook = xlwt.Workbook()
Testsheet = workbook.add_sheet('test')
print "Enter the row you want"
row=input()
print "Enter the column you want"
col=input()
for file in os.listdir('.'):
wb = xlrd.open_workbook(file)
wb.sheet_names()
sh = wb.sheet_by_name(u'Sheet1')
data = sh.cell(row,col).value
Testsheet.write(0, index, data)
index=index+1
workbook.save('Test.xls')
누구든지이 작업을 성공적으로 수행 할 수 있습니까?