def in_file_string_replace(filename, old_string, new_string):
    """ String replacement within a text file. It is used to fix typos in
    downloaded csv file.
    The code was modified from "https://stackoverflow.com/questions/4128144/    replace-string-within-file-contents"

    Parameters
    ----------
    filename : string
        Path to the file where strings should be replaced
    old_string : str
        The string to be replaced in the file.
    new_string : str
        The new string that will replace old_string

    """
    with open(filename) as f:
        s = f.read()
    with open(filename, 'w') as f:
        s = s.replace(old_string, new_string)
        f.write(s)
