feat: 根目录文档、脚本、gitignore
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import openpyxl, io, sys
|
||||
|
||||
wb = openpyxl.load_workbook(r'F:/zentao/1/pm/docs/信息技术部绩效考核标准-新版 - AI下的考核方案.xlsx', data_only=True)
|
||||
out = io.open(r'F:/zentao/1/pm/tmp/xlsx_dump.txt', 'w', encoding='utf-8')
|
||||
for name in wb.sheetnames:
|
||||
ws = wb[name]
|
||||
out.write(u'===== SHEET: %s (rows=%d, cols=%d) =====\n' % (name, ws.max_row, ws.max_column))
|
||||
# merged cells
|
||||
out.write(u'-- merged: %s\n' % ([str(r) for r in ws.merged_cells.ranges],))
|
||||
for row in ws.iter_rows():
|
||||
vals = []
|
||||
for c in row:
|
||||
v = c.value
|
||||
if v is None:
|
||||
vals.append(u'')
|
||||
else:
|
||||
vals.append(unicode(v) if sys.version_info[0] == 2 else str(v))
|
||||
line = u' | '.join(vals).rstrip(u' |')
|
||||
if line.strip():
|
||||
out.write(u'R%d: %s\n' % (row[0].row, line))
|
||||
out.write(u'\n')
|
||||
out.close()
|
||||
print('done')
|
||||
Reference in New Issue
Block a user