- 공공기관2/3 작업본 + 오늘 제출 17곳 D~J 카테고리 셀병합 정상화 - 한국지역난방공사 옵션2(고아셀 F98 수정)+전행 높이17 - 제출_프리랜서2_2026-06-21.zip 생성(17개 xlsx, 2,468행) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
877 B
Python
19 lines
877 B
Python
# -*- coding: utf-8 -*-
|
|
import sys, io, openpyxl
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
P=r'3.한국의약품안전관리원/한국의약품안전관리원.xlsx'
|
|
D1={'의약품 이상사례보고','의약품 안전관리','DUR 정보','부작용 피해구제','임상시험안전지원','알림마당','교육·홍보','정보공개','기관소개'}
|
|
wb=openpyxl.load_workbook(P); ws=wb.active
|
|
fixed=[]
|
|
for r in range(3, ws.max_row+1):
|
|
d=ws.cell(r,4).value; e=ws.cell(r,5).value; f=ws.cell(r,6).value
|
|
if d in D1 and (e in (None,'')) and (f in (None,'')):
|
|
# pure category header → clear K..Q
|
|
for c in range(11,18): # K(11)..Q(17)
|
|
ws.cell(r,c).value=None
|
|
ws.cell(r,c).hyperlink=None
|
|
fixed.append((r,d))
|
|
wb.save(P)
|
|
for r,d in fixed: print('cleared d1 header row',r,d)
|
|
print('total',len(fixed))
|