def _getkey(keystr):
    """
    Format key strings.
    From JCAMP-DX specs :
    "When LABELS are parsed, alphabetic
    characters are converted to upper case, and all spaces,
    dashes, slashes, and underlines are discarded. (XUNITS,
    xunits, xUNITS, and X-UNITS are equivalent.)"
    """
    return keystr.strip().upper().replace(' ', '').replace('-', '').replace('_'
        , '').replace('/', '')
