I want to add robustness to my AMPL code, here is what I am actually doing: In my script I use a .txt file that contains all my parameters, lets call it "instance.txt". I want to print my result in another txt file and call it "output_instance.txt". This is not an issue for me.
However, I may try the code with several instances and thus use many files "instance0.txt", "instance1.txt", "instance2.txt" etc.
I would like to genralize the above by writing :
param filename := "instance.txt" print blablabla > out ("output" & filename)
The purpose of doing this is to have a specific file name for each output.
The first line generate this error (I don't know if the second is correct) :
error processing param filename: can't convert 'instance.txt' to a number.
I read the chapter about strings in the ampl book but I didn't find what I was looking for.
Please tell me if you have a way of doing this with .txt files or with .dat files