in reply to Reading from txt makes variables literal?

As [id://Japhy] suggests, it seems you are looking for a text templating system. One of the simplest ones out there is Text-Template.

  • Comment on Re: Reading from txt makes variables literal?