import openpyxl, os, json
path='/Users/qianliyun/.hermes/profiles/feishu8/cache/documents/doc_263f11c0d204_万物有灵项目利润分配表 2026.5.14.xlsx'
wb = openpyxl.load_workbook(path, data_only=False)
print('FILE', path)
print('SHEETS', wb.sheetnames)
for ws in wb.worksheets:
    print('\n---SHEET', ws.title, '---')
    print('dimensions', ws.max_row, ws.max_column)
    merged=list(ws.merged_cells.ranges)
    print('merged_count', len(merged), 'merged_sample', [str(x) for x in merged[:20]])
    maxr=min(ws.max_row, 80); maxc=min(ws.max_column, 35)
    for r in range(1,maxr+1):
        vals=[]; non=False
        for c in range(1,maxc+1):
            v=ws.cell(r,c).value
            if v is not None:
                non=True
                s=str(v).replace('\n',' / ')
                if len(s)>60: s=s[:57]+'...'
            else:
                s=''
            vals.append(s)
        if non:
            print(str(r).rjust(3), ' | '.join(vals))
    formulas=[]
    for row in ws.iter_rows():
        for cell in row:
            if isinstance(cell.value, str) and cell.value.startswith('='):
                formulas.append((cell.coordinate, cell.value))
    print('formula_count', len(formulas))
    for coord, formula in formulas[:80]:
        print('FORMULA', coord, formula)
