import sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
import openpyxl
P = r'D:\01.프로젝트\DB수집\작업파일\광역_사이트맵\충청남도\10.아산시\충청남도_아산시.xlsx'
wb = openpyxl.load_workbook(P)
ws = wb.active

def rowvals(r):
    g = lambda col: ws[f'{col}{r}'].value
    return {c: g(c) for c in ['B','C','D','E','F','G','H','I','J','K','L','M','N','O','S']}

print('=== search 장영실 / no=55 ===')
for r in range(3, ws.max_row+1):
    vals = [ws.cell(r, c).value for c in range(1, 20)]
    joined = ' '.join(str(v) for v in vals if v)
    if '장영실' in joined or 'no=55' in joined:
        print('ROW', r, '| B(순번)=', ws[f'B{r}'].value, '| D=', repr(ws[f'D{r}'].value), '| E=', repr(ws[f'E{r}'].value),'| F=',repr(ws[f'F{r}'].value),'| G=',repr(ws[f'G{r}'].value))
        print('     K=', repr(ws[f'K{r}'].value), '| L=', repr(ws[f'L{r}'].value),'| M=',repr(ws[f'M{r}'].value),'| N=',repr(ws[f'N{r}'].value),'| O=',repr(ws[f'O{r}'].value),'| S=',repr(ws[f'S{r}'].value))

print('\n=== Excel rows 24-40 (D/E/F/G/K/L/M/N/O/S) ===')
for r in range(24, 41):
    print(f'r{r} B={ws[f"B{r}"].value!r} D={ws[f"D{r}"].value!r} E={ws[f"E{r}"].value!r} F={ws[f"F{r}"].value!r} G={ws[f"G{r}"].value!r}')
    print(f'      K={ws[f"K{r}"].value!r} L={ws[f"L{r}"].value!r} M={ws[f"M{r}"].value!r} N={ws[f"N{r}"].value!r} O={ws[f"O{r}"].value!r} S={ws[f"S{r}"].value!r}')
