New to groovy as part of upskilling, please help. I have a text file with content below:
Name is $vName City is $vCity
I read this file as follows.
def vName="John"
def vCity="NewYork"
def fData = readFile(file: "c:\data.txt")
print fData
I would need to replace the variables vName and vCity with its values and print them. Is there a way i can get the variables resolved ?
I have executed the script. but it does not work
Here is how it could be solved with SimpleTemplateEngine: