Replace any template variables found in filenames