import re


def process_output_name(encode_string):
    """Removes all bad characters in a string so it can be used as a file name.
    """
    return_string = re.sub('[^\w\-_\. ]', '_', encode_string)
    return_string = return_string.replace(' ', '_')
    return return_string