String formatting, using $

Hi, I am trying to make it easy for me to load different data files and later plot them and add them into file locations. It would be really nice to be able to specify the scenario I am plotting and then just using $scenario would fix so that I load and save the right files.

This is the wrong way to do it, so what am I doing wrong and does anyone have suggestions on how to do this?

`scenario = “baseline”

simulations = load(“simulations/data_$scenario/1000ind.jld2”)[“simulations”]`

I usually use joinpath to combine a basedir with a filename.

Slashes work perfectly well (even on windows). joinpath has the advantage of giving you consistent forward/backslashes when you mix paths from different sources, e.g. joinpath(@__DIR__, "foo", "bar.txt")

What error are you getting?

Thank you guys! Joinpath seems like a really nice way to do it. It is so nice to learn more ways of doing things! Well, it turns out that the reason why it didn`t work for me in the first place was because there was actually something wrong with the file I was loading and that the way I did it does work when I loaded another file.