| 12345678910111213141516171819202122232425 |
- # -*- coding: utf-8 -*-
- from pathlib import Path
- from docx import Document
- d = Path(r"C:\Users\skygu\OneDrive\Projects\AIDOP\项目\项目管理\产互联项目管理\交付文档\系统集成")
- OPENING = "本模块对接的第三方系统涉及 ERP、MES、WMS"
- for p in sorted(d.glob("*V0.4.docx")):
- if p.name.startswith("~$"):
- continue
- doc = Document(str(p))
- hits = []
- for para in doc.paragraphs:
- t = para.text.strip()
- if any(x in t for x in ("ERP", "MES", "WMS", "CRM", "SRM", "TMS")):
- hits.append(t)
- for table in doc.tables:
- for row in table.rows:
- for cell in row.cells:
- t = cell.text.strip()
- if any(x in t for x in ("ERP", "MES", "WMS", "CRM", "SRM", "TMS")):
- hits.append(t)
- leftover = [h for h in hits if OPENING not in h]
- print("====", p.name, "named", len(hits), "leftover", len(leftover))
- for h in leftover:
- print(" ", h[:160])
|