def list2map(listoffilenames, delimiter):
    """
    convert a list to a map

    :param listoffilenames: list of filenames
    :param delimiter: common separator used in filenames
    :return: map/dictionary of list with key of filename before delimiter and value of complete filename
    """
    return dict(map(lambda x: [x.split(delimiter)[0], x], listoffilenames))