21 lines
806 B
Python
21 lines
806 B
Python
import os, sys
|
|
sys.path.append('scratch')
|
|
from find_strict_grouped_tables import true_grouped_tables
|
|
|
|
sys.stdout.reconfigure(encoding='utf-8')
|
|
road_tables = [t for t in true_grouped_tables if t['file'] == '제1장_도로포장공사.md']
|
|
|
|
with open('resources/knowledge/original/원가계산/건설공사_표준품셈/02_토목부문/제1장_도로포장공사.md', 'r', encoding='utf-8') as f:
|
|
lines = f.readlines()
|
|
|
|
for t in road_tables:
|
|
lno = t['line']
|
|
print(f"\n=======================================================")
|
|
print(f"L{lno}: {t['title']}")
|
|
print(f"Groups: {t['groups']}")
|
|
# print table content around line
|
|
start = max(0, lno - 2)
|
|
end = min(len(lines), lno + t['total_rows'] + 3)
|
|
for i in range(start, end):
|
|
print(f"{i+1:4d}: {lines[i].rstrip()}")
|