DB_JOB/작업파일/공공기관3/_dump.py
hehihoho3 b0acd1e705 백업: 셀병합 정상화(D~J)+KDHC 옵션2/행높이17, 오늘(06-21) 제출 17곳 검수·압축
- 공공기관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>
2026-06-21 13:21:26 +09:00

26 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
import sys, io, openpyxl, collections
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
wb=openpyxl.load_workbook(r'3.한국의약품안전관리원/한국의약품안전관리원.xlsx'); ws=wb.active
last=2
for r in range(3,ws.max_row+1):
if ws.cell(r,2).value is None and all(ws.cell(r,c).value in(None,'') for c in range(4,12)): continue
last=r
Lc=collections.Counter(); Oc=collections.Counter(); Nc=collections.Counter()
kogl=0
for r in range(3,last+1):
L=ws.cell(r,12).value; O=ws.cell(r,15).value; N=ws.cell(r,14).value
Lc[L]+=1
if O and O!='미부착': kogl+=1; Oc[O]+=1
Nc[N]+=1
print('lastrow',last,'(data rows', last-2,')')
print('L:',dict(Lc))
print('KOGL부착:',kogl,'O유형분포:',dict(Oc))
print('N:',dict(Nc))
print('--- KOGL rows (O,P,Q) ---')
for r in range(3,last+1):
O=ws.cell(r,15).value
if O and O!='미부착':
leaf=ws.cell(r,6).value or ws.cell(r,5).value or ws.cell(r,4).value
print(r,leaf,'| L=',ws.cell(r,12).value,'O=',O,'P=',ws.cell(r,16).value,'Q=',ws.cell(r,17).value)