Replace stings in a file based on the current values