import re


def _parse_txt_channel(header: str) -> str:
    """Extract channel and label from text headers and return channels as formatted by
    MCDViewer. e.g. 80ArAr(ArAr80Di) -> ArAr(80)_80ArAr
    Args:
        headers: channel text header
    Returns:
        Channel header renamed to be consistent with MCD Viewer output
    """
    label, metal, mass = re.findall(r"(.+)\(([a-zA-Z]+)(\d+)Di\)", header)[0]
    return f"{metal}({mass})_{label}"