Performing replacement directly in the file