You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
# -*- coding: utf-8 -*-
|
|
# t08-extract.py — A4 关键页批注区提取
|
|
import io, sys
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
|
|
base = '.scratch/opportunity-bugfix/lanhu-pages/'
|
|
files = [
|
|
'A4-3-3-1_新增客户信息.md', # 客户主档字段集
|
|
'A4-1-1_客户公海列表(列表视图).md', # 公海机制
|
|
'A4-6-3_客户合并.md', # 合并深水区
|
|
'A4-7-1_客户交割(发起交接).md', # 交割深水区
|
|
]
|
|
for fn in files:
|
|
lines = open(base + fn, 'r', encoding='utf-8').read().splitlines()
|
|
print(f'\n===== {fn} ({len(lines)} 行) =====')
|
|
idx = [i for i, ln in enumerate(lines) if '、开发说明' in ln or '【页面名称】' in ln]
|
|
seen = set()
|
|
printed = 0
|
|
for i in idx:
|
|
for j in range(i, min(i + 5, len(lines))):
|
|
if j in seen:
|
|
continue
|
|
seen.add(j)
|
|
ln = lines[j]
|
|
if len(ln) > 400: # 大单元格=批注内容
|
|
print(ln[:6000])
|
|
printed += 1
|
|
break
|
|
if not printed:
|
|
print('(无大单元格批注)')
|
|
print('\ndone')
|
|
|