def invert_dict_byindex(d, index=0):
    """ Function that invert data by value index number

    parameters:
    d (dictionary): The content of the text file as dictionary
    index(int): The value index to be inverted

    returns:
    dict: Inverted data by value index number as dictionary
    """
    invert_data = dict()
    for key, value in d.items():
        if value[index].upper() not in invert_data:
            invert_data[value[index].upper()] = [key.upper()]
        else:
            invert_data[value[index].upper()].append(key.upper())
    return invert_data
