import re


def clean_batch(batch: str, delimiter: str = "\n") -> str:
    """
    Clean a batch file by replacing Windows (CR-LF) newlines with the specified
    newline delimiter (LF by default).

    Also, strip vertical tab and file separator characters which can appear in
    input batch file data.
    """
    cleansed_batch = re.sub("[\r\n]+", delimiter, batch)

    # These are unicode for vertical tab and file separator, respectively
    # \u000b appears before every MSH segment, and \u001c appears at the
    # end of the message in some of the data we've been receiving, so
    # we're explicitly removing them here.
    cleansed_batch = re.sub("[\u000b\u001c]", "", cleansed_batch).strip()
    return cleansed_batch