Replace an associative array of strings in a file