def readDirective(s):
    """Reads a directive line from forcefield, itp, or rtp file."""
    # Remove comments, then split normally
    sline = s.split(';')[0].split()
    
    if len(sline) == 3 and sline[0] == '[' and sline[2] == ']':
        return sline[1]
    else:
        return ''