Files
C4IT-F4SD-Client/remove_blank_lines.py
2025-11-11 11:03:42 +01:00

21 lines
763 B
Python

from pathlib import Path
path = Path("F4SDCockpitCommunicationDemo.cs")
lines = path.read_text(encoding="utf-8").splitlines()
start = None
end = None
for idx, line in enumerate(lines):
if line.strip() == "private void LoadTicketOverviewRelations()":
start = idx
continue
if start is not None and line.strip().startswith("private bool LoadMockupData"):
end = idx
break
if start is None or end is None:
raise SystemExit('Could not locate method boundaries for LoadTicketOverviewRelations')
method_lines = lines[start:end]
filtered = [line for line in method_lines if line.strip()]
filtered.append("")
new_lines = lines[:start] + filtered + lines[end:]
path.write_text("\r\n".join(new_lines) + "\r\n", encoding="utf-8")