How to read a string from a file with interpolation

mkarikom
Wed, 07 Oct 2020 05:30:38 +0000
New to Julia

The file “test.txt” contains a single line:

I am $me

The following is intended to simply read the string and store the interpolated result in str:

me = "Sam"
str = read("test.txt", String);
str == "I am Sam"
false

8 posts - 5 participants