📦 Initialize Geulbeot structure and merge Prompts & test projects
This commit is contained in:
11
02. Prompts/문서생성/codedomain/멀티라인_대응_Python_v01.py
Normal file
11
02. Prompts/문서생성/codedomain/멀티라인_대응_Python_v01.py
Normal file
@@ -0,0 +1,11 @@
|
||||
def get_item_id_with_lookback(ws, row, col, section_start_row):
|
||||
"""멀티라인 대응 상향 번호 탐색 - 섹션 경계 존중"""
|
||||
for r in range(row, section_start_row - 1, -1):
|
||||
# 새로운 섹션을 만나면 탐색 중단
|
||||
f_val_check = str(ws.cell(row=r, column=6).value or "").strip()
|
||||
if r != row and re.match(r'^\(.*\)$|^\[.*\]$', f_val_check):
|
||||
break
|
||||
|
||||
# F열에서 번호 탐색
|
||||
if re.search(ID_MARKER_PATTERN, f_val_check):
|
||||
return re.search(ID_MARKER_PATTERN, f_val_check).group()
|
||||
Reference in New Issue
Block a user