def files_data_generation(candidates, namesmeasures):
    """Select all possible files that are related with the given measures."""
    selected = []
    for name in namesmeasures:
        sele_name = []
        for i in range(len(candidates)):
            if name in candidates[i]:
                sele_name.append(candidates[i])
        selected.append(sele_name)
    return selected