def load_headers(meta_dict, separator, name_ext):
    """
    Loads headers with name_ext (e.g '.csv') from the file and saves them, filename and file location into a meta_dict
    dictionary where file location is the KEY.

    :param meta_dict:
    :param separator: data splitting between these. e.g ','  (String)
    :param name_ext: target file extension. e.g '.csv'  (String)
    :return meta_dict: Metadata stored in a dictionary. PATH to a file is the KEY and it includes HEADERS and FILENAME
    """

    for path in meta_dict:
        if path.endswith(name_ext):
            file_obj = open(path, 'r')
            headers = file_obj.readline().rstrip().split(separator)
            meta_dict[path].update({'headers': headers})
            file_obj.close()
    return meta_dict