from pathlib import Path
import openpyxl, json
p=Path('/Users/neo/.hermes/cache/documents/doc_259cbd37e734_万传安徽_V9_v2.1_R66拆3sub+12sub行全拆开_20260512.xlsx')
wbf=openpyxl.load_workbook(p,data_only=False,read_only=False,keep_links=True)
wbv=openpyxl.load_workbook(p,data_only=True,read_only=False,keep_links=True)
print('sheets', len(wbf.sheetnames), 'has', '现金流量表' in wbf.sheetnames, '长期资产循环_全量穿透校验' in wbf.sheetnames)
for sheet, rows, cols in [('现金流量表', range(1,60), range(1,15)), ('现金流量表底稿', list(range(180,206))+list(range(238,252))+list(range(406,425)), range(1,5)), ('长期资产循环_全量穿透校验', range(29,59), range(1,15)), ('资产减值明细表', range(20,27), range(1,6))]:
    print('\n###', sheet)
    wsf=wbf[sheet]; wsv=wbv[sheet]
    for r in rows:
        vals=[]
        for c in cols:
            coord=wsf.cell(r,c).coordinate
            f=wsf.cell(r,c).value
            v=wsv.cell(r,c).value
            if f is not None or v is not None:
                vals.append(f'{coord}:F={f!r}|V={v!r}')
        if vals:
            print('ROW',r,' || '.join(vals))
