/**
https://www.w3cschool.cn/groovy/groovy_template_engines.html
**/
import groovy.text.* 
import java.io.* 

def name = "Groovy" 
println "This Tutorial is about ${name}"

def text ='''
This Tutorial focuses on $TutorialName. In this tutorial you will learn 

about $Topic
'''  

def binding = ["TutorialName":"Groovy", "Topic":"Templates"]  
def engine = new SimpleTemplateEngine() 
def template = engine.createTemplate(text).make(binding) 

println template


def file = new File("D:/Student.template") 
binding = ['name' : 'Joe', 'id' : 1, 'subject' : 'Physics']
				  
template = engine.createTemplate(file) 
def writable = template.make(binding1) 

println writable