Search and replace tokens in a file.