공공기관2 작업 중. _temp 몽타주(재생성가능)는 제외. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
30 lines
1.4 KiB
Python
30 lines
1.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
# 백업 vs 현재, B순번 기준 정렬 비교. F라벨/L/N 차이 전수출력(123+ 영역, B순번 124+)
|
|
import openpyxl, io, sys
|
|
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')
|
|
BK=r'D:\01.프로젝트\DB수집\작업파일\광역_사이트맵\충청남도\13.청양군\충청남도_청양군_backup_재검토전.xlsx'
|
|
CU=r'D:\01.프로젝트\DB수집\작업파일\광역_사이트맵\충청남도\13.청양군\충청남도_청양군.xlsx'
|
|
def load(F):
|
|
wb=openpyxl.load_workbook(F); ws=wb.active
|
|
d={}
|
|
for r in range(3,ws.max_row+1):
|
|
b=ws.cell(r,2).value
|
|
if b is None: continue
|
|
f=ws.cell(r,6).value or ws.cell(r,7).value or ws.cell(r,5).value
|
|
d[b]=(str(f or '')[:18], ws.cell(r,12).value, ws.cell(r,14).value, r)
|
|
return d
|
|
bk=load(BK); cu=load(CU)
|
|
print('백업 B개수',len(bk),'| 현재 B개수',len(cu))
|
|
delB=sorted(set(bk)-set(cu)); addB=sorted(set(cu)-set(bk))
|
|
print('삭제된 B순번(셸):',delB)
|
|
print('추가된 B순번:',addB)
|
|
print('=== B순번 공통 중 L 또는 라벨 변경(124+) ===')
|
|
for b in sorted(set(bk)&set(cu)):
|
|
if b<124: continue
|
|
fb,lb,nb,rb=bk[b]; fc,lc,nc,rc=cu[b]
|
|
diffs=[]
|
|
if fb!=fc: diffs.append('라벨 %s->%s'%(fb,fc))
|
|
if lb!=lc: diffs.append('L %s->%s'%(lb,lc))
|
|
if diffs:
|
|
print('B%s (cur r%d) %-18s | %s'%(b,rc,fc,' | '.join(diffs)))
|