import re


def _load_line(fh) -> str:
    """Loads a line from the file,
    skipping blank lines.  Validates
    format, and removes whitespace.
    """
    while True:
        line = fh.readline()
        line = line.rstrip()
        line = re.sub(" ", "", line)
        if line:
            # Not blank.
            assert len(line)==9, f"Invalid {line=}"
            return line
        # else blank line, keep reading