import os, sys sys.stdout.reconfigure(encoding='utf-8') ch13_path = "resources/knowledge/original/원가계산/건설공사_표준품셈/04_기계설비부문/제13장_플랜트설비공사.md" with open(ch13_path, 'r', encoding='utf-8') as f: text = f.read() # 1. L149 old_l149 = "| 배 관 용 탄 소 강 관 KS D3 50 7 | 850 〃 〃 900 〃 〃 〃 1000 〃 1100 〃 1200 〃 1350 〃 | 863.6 〃 〃 914.4 〃 〃 〃 1016.0 〃 1117.6 〃 1219.2 〃 1371.6 〃 | 7.9 9.5 12.7 6.4 7.9 8.7 12.7 8.7 10.3 10.3 11.1 11.1 11.9 11.9 12.7 | 167 200 266 143 177 194 282 216 255 281 303 331 354 399 426 | 16.5 15.1 13.1 18.3 16.5 15.7 13.0 15.7 14.5 14.4 13.8 13.9 13.4 13.4 12.9 | 8.2 7.5 6.5 9.2 8.2 7.9 6.5 7.8 7.2 7.2 6.9 6.9 6.7 6.7 6.5 | 8.2 7.5 6.5 9.2 8.2 7.9 6.5 7.8 7.2 7.2 6.9 6.9 6.7 6.7 6.5 | 16.5 15.1 13.1 18.3 16.5 15.7 13.0 15.7 14.5 14.4 13.8 13.9 13.4 13.4 12.9 |" s149 = "850 〃 〃 900 〃 〃 〃 1000 〃 1100 〃 1200 〃 1350 〃".split() o149 = "863.6 〃 〃 914.4 〃 〃 〃 1016.0 〃 1117.6 〃 1219.2 〃 1371.6 〃".split() t149 = "7.9 9.5 12.7 6.4 7.9 8.7 12.7 8.7 10.3 10.3 11.1 11.1 11.9 11.9 12.7".split() w149 = "167 200 266 143 177 194 282 216 255 281 303 331 354 399 426".split() yw149 = "16.5 15.1 13.1 18.3 16.5 15.7 13.0 15.7 14.5 14.4 13.8 13.9 13.4 13.4 12.9".split() yb149 = "8.2 7.5 6.5 9.2 8.2 7.9 6.5 7.8 7.2 7.2 6.9 6.9 6.7 6.7 6.5".split() yi149 = "8.2 7.5 6.5 9.2 8.2 7.9 6.5 7.8 7.2 7.2 6.9 6.9 6.7 6.7 6.5".split() nb149 = "16.5 15.1 13.1 18.3 16.5 15.7 13.0 15.7 14.5 14.4 13.8 13.9 13.4 13.4 12.9".split() rows_149 = [] for i in range(len(s149)): div_name = "배관용 탄소강관 KS D3507" if i == 0 else "" row = f"| {div_name} | {s149[i]} | {o149[i]} | {t149[i]} | {w149[i]} | {yw149[i]} | {yb149[i]} | {yi149[i]} | {nb149[i]} |" rows_149.append(row) new_l149 = "\n".join(rows_149) text = text.replace(old_l149, new_l149) # 2. L158 old_l158 = "| 배 관 용 탄 소 강 관 KS D3 50 7 | 1350 1500 〃 〃 | 1371.6 1574 〃 〃 | 13.1 12.7 13.1 15.1 | 439 473 488 562 | 12.7 13.1 12.9 12.1 | 6.4 6.6 6.5 6.0 | 6.4 6.6 6.5 6.0 | 12.7 13.1 12.9 12.1 |" s158 = "1350 1500 〃 〃".split() o158 = "1371.6 1574 〃 〃".split() t158 = "13.1 12.7 13.1 15.1".split() w158 = "439 473 488 562".split() yw158 = "12.7 13.1 12.9 12.1".split() yb158 = "6.4 6.6 6.5 6.0".split() yi158 = "6.4 6.6 6.5 6.0".split() nb158 = "12.7 13.1 12.9 12.1".split() rows_158 = [] for i in range(len(s158)): div_name = "배관용 탄소강관 KS D3507" if i == 0 else "" row = f"| {div_name} | {s158[i]} | {o158[i]} | {t158[i]} | {w158[i]} | {yw158[i]} | {yb158[i]} | {yi158[i]} | {nb158[i]} |" rows_158.append(row) new_l158 = "\n".join(rows_158) text = text.replace(old_l158, new_l158) # 3. L159 old_l159 = "| 압력배관용 탄 소 강 관 KSD3562 SCH#40 | 6 8 10 | 10.5 13.8 17.3 | 1.7 2.2 2.3 | 0.369 0.629 0.851 | 101.3 70.7 59.9 | 50.7 35.3 29.9 | 50.7 35.3 29.9 | 101.3 70.7 59.9 |" s159 = "6 8 10".split() o159 = "10.5 13.8 17.3".split() t159 = "1.7 2.2 2.3".split() w159 = "0.369 0.629 0.851".split() yw159 = "101.3 70.7 59.9".split() yb159 = "50.7 35.3 29.9".split() yi159 = "50.7 35.3 29.9".split() nb159 = "101.3 70.7 59.9".split() rows_159 = [] for i in range(len(s159)): div_name = "압력배관용 탄소강관 KSD3562 SCH#40" if i == 0 else "" row = f"| {div_name} | {s159[i]} | {o159[i]} | {t159[i]} | {w159[i]} | {yw159[i]} | {yb159[i]} | {yi159[i]} | {nb159[i]} |" rows_159.append(row) new_l159 = "\n".join(rows_159) text = text.replace(old_l159, new_l159) with open(ch13_path, 'w', encoding='utf-8') as f: f.write(text) print("Updated L149, L158, L159 in 제13장_플랜트설비공사.md successfully.")