print in excel parameter without domain index

Questions on using the GAMS APIs (Python, .NET, etc.)
Post Reply
perea@eio.upv.es
User
User
Posts: 9
Joined: 6 years ago

print in excel parameter without domain index

Post by perea@eio.upv.es »

Hello,

I am trying to print in an excel sheet the values of a certain parameter, but I don't want for the domain set to be printed as well.

For example, if I run:

execute_unload 'results.gdx' x_model
$onecho > gdxxrw_args_100.txt
par=x_model rng=RCG_results!a1
$offecho
execute 'gdxxrw.exe results.gdx @gdxxrw_args_100.txt';

I get something like:

1 2 3 4 5 6 7 8 9 10 11 12
1,32 0,88 0,88 1,44 0,44 1,44 0,88 1,44 1,32 2,76 0,44 1,76

What I want is just to have the second row (the actual values of x_model and not the indexes).

Thanks!

Fede
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: print in excel parameter without domain index

Post by Renger »

Hi Fede
I don't think this is possible. You could however, write an Excel macro which deletes the row when closing the excel file using the gdxxrw option Runmacros = 2.
Hope this helps
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
perea@eio.upv.es
User
User
Posts: 9
Joined: 6 years ago

Re: print in excel parameter without domain index

Post by perea@eio.upv.es »

Thanks Renger. I'll try that or, the easier brute force: define one scalar for each index value :)
Post Reply