- 공공기관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>
23 lines
723 B
Python
23 lines
723 B
Python
# -*- coding: utf-8 -*-
|
|
import openpyxl,shutil,re
|
|
from openpyxl.styles import PatternFill
|
|
SRC='한국중부발전.xlsx'
|
|
shutil.copy(SRC,'한국중부발전_backup_N재검수전.xlsx')
|
|
wb=openpyxl.load_workbook(SRC);ws=wb.active
|
|
BLUE=PatternFill('solid',fgColor='BDD7EE')
|
|
changes={157:'어문,이미지', 223:'어문,영상'}
|
|
for r,v in changes.items():
|
|
old=ws.cell(r,14).value
|
|
ws.cell(r,14).value=v
|
|
ws.cell(r,14).fill=BLUE
|
|
print(f'r{r}: {old!r} -> {v!r}')
|
|
# trailing-space normalize across N
|
|
fixn=0
|
|
for r in range(3,ws.max_row+1):
|
|
n=ws.cell(r,14).value
|
|
if isinstance(n,str) and n!=n.strip():
|
|
ws.cell(r,14).value=n.strip();fixn+=1
|
|
print('N 공백정규화:',fixn)
|
|
wb.save(SRC)
|
|
print('saved')
|