0
$\begingroup$

This question already has an answer here:

I want to import a data file named "A(var1)B(var2)C(var3).dat" where the values of the variables var1, var2, var3 are being provided by a function. How can I do that?

$\endgroup$

marked as duplicate by Kuba Dec 1 '18 at 13:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Take a look at StringJoin, ToString or at StringTemplate. $\endgroup$ – Kuba Dec 1 '18 at 12:42
0
$\begingroup$
a = 2;
b = 4;
c = 5;
StringJoin[ToString[a], ToString[b], ToString[c], ".dat"]    

"245.dat"

or you can add more strings

StringJoin["A",ToString[a],"_B",ToString[b],"_C",ToString[c], ".dat"]   

"A2_B4_C5.dat"

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.