Thanks, this answer helped me out as well.
However:
The following code now works until I include the print control with quoted text, which makes the renaming command ‘ren’ and my directory unreadable by adding extra quotes around them.
I’m sure there’s several easy ways to work around it, and I would be very glad and thankful if you could point me towards one of them?
FILE SCENARIOS_OUT / ‘Output\Hourly_Output\Scenario_Output\test.txt’ /;
**********************SCENARIOS_OUT.pc = 5;
loop(model_years_ID,
put SCENARIOS_OUT;
put_utilities ‘ren’ / 'Output\Hourly_Output\Scenario_Output':0 Model_Years_ID.tl:0 ‘.txt’:0 ;
put “bla bla bla”;
putclose SCENARIOS_OUT;
);
Best regards,
Roger - Frustrated GAMS user…
On Tuesday, February 7, 2012 10:44:28 PM UTC+1, AC wrote:
That’s awesome, thanks Michael
On Feb 7, 8:55 pm, Michael Bussieck wrote:
You can use the put_utility ‘ren’ for this. The following document has
the details:http://www.gams.com/mccarl/pututility.pdf
Hope this helps,
Michael Bussieck - GAMSWorld Coordinator
On Feb 6, 10:29 pm, AC wrote:
Hi
We want to loop over a set of scenarios, and for each scenario write a
report where the filename contains the scenario. For example if I had
2 scenarios x and y I would want my report file to be report_x.csv and
report_y.csv
I think I can do this using $batlinclude, something roughly like:
loop (scenario) do
$batinclude active_file_name scenario
put “report starts here”;
:
putclose;
endloop;
and the file activate_file_name.gms will simply be something like:
put report_%1
I have not actually tried the above yet to check it works [and as I
type i realise I would need something similar to do the initial file
declarations]. My question is whether there is a better/easier way to
do this?
Thanks
AndyC
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
\