# -*- coding: utf-8 -*-
import pathlib, re, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
BASE = pathlib.Path(r"D:\work buddy\2026-11-05-14-15-52")
for k in ["nyu-bul-mechanical-engineering-ms", "nyu-bul-biomedical-engineering-ms", "nyu-bul-industrial-engineering-ms",
          "nyu-bul-computer-engineering-ms", "nyu-bul-cybersecurity-ms", "nyu-bul-ece"]:
    t = (BASE / f"_r345_txt_{k}.txt").read_text(encoding="utf-8")
    print("=====", k)
    for m in re.finditer(r"[^\n]*requires (?:the )?completion of [^\n]*|The [^\n]*requires \d+ credits[^\n]*|Total Credits[^\n]*", t):
        print("  ", m.group(0).strip()[:160])
    for m in re.finditer(r"(?s)Total Credits\s*\n\s*(\d+)", t):
        print("   total->", m.group(1))
