def load_db_to_dictionary(name):
    """
    input: file (without .csv)
    return: dict of dictionaries, every dict item is a car, every dict key is the car's characteristic's name, and the
    value returned from the key is the value of the characteristic.

    :param name:
    :return:
    """
    file = open(name + '.csv', 'r', encoding='ISO-8859-1')
    A = file.readline()
    Characteristics = []
    Out = {}
    while A != '':
        k = A.find(',')
        if k == -1:
            Characteristics.append(A)
            A = ''
        else:
            Characteristics.append(A[:k])
            A = A[k + 1:]
    for line in file:
        C = {}
        for i in range(len(Characteristics) - 1):
            k = line.find(',')
            C[Characteristics[i]] = line[:k]
            line = line[k + 1:]
        C[Characteristics[-1].rstrip('\n')] = line.rstrip('\n')
        Out[int(C[Characteristics[0]])] = C
    file.close()
    return Out
