Want to output eps as a BLANK (empty) cell when doing gdxxrw write to Excel

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.


Thanks
AndyC


\

Andy,

See below using a single quote. Not sure how the email deals with the quote, but I wrote EpsOut=. This also works on the command line without an @ file

–Paul

====================
set i /i1*i2/;
parameter A(i) /i1=1, i2=Eps/;

$onecho > task.txt
EpsOut=’
par=A rng=A1
$offecho

execute_unload “test.gdx”, A;
execute “gdxxrw test.gdx o=test.xlsx @task.txt”;

On Mon, Mar 14, 2011 at 7:51 PM, AC wrote:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.


Thanks
AndyC

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Nice idea Paul.

Visually it puts a blank in Excel, the cells appear empty. But it has
that little ’ in there, and it’s the having something (anything) in
there which is causing us issues.


Any other ideas?

Cheers
AndyC


On Mar 16, 6:02 am, Paul Van der Eijk wrote:

Andy,

See below using a single quote. Not sure how the email deals with the quote,
but I wrote EpsOut=. This also works on the command line
without an @ file

–Paul

====================
set i /i1*i2/;
parameter A(i) /i1=1, i2=Eps/;

$onecho > task.txt
EpsOut=’
par=A rng=A1
$offecho

execute_unload “test.gdx”, A;
execute “gdxxrw test.gdx o=test.xlsx @task.txt”;

On Mon, Mar 14, 2011 at 7:51 PM, AC wrote:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.

Thanks
AndyC


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


Paul van der Eijk
GAMS Development Corporation
Tel :frowning:202) 342-0180begin_of_the_skype_highlighting (202) 342-0180 end_of_the_skype_highlighting Fax : (202) 342-0181
Email: pvandere...@gams.com
Web :http://www.gams.com- Hide quoted text -

  • Show quoted text -

    \

Reply-to: gamsworld@googlegroups.com

More complicated is to write the full domain of your parameter and use the clear option.

See example 11 and 12 in the gdxutils document.

–Paul



On Tue, Mar 15, 2011 at 6:00 PM, AC wrote:

Nice idea Paul.

Visually it puts a blank in Excel, the cells appear empty. But it has
that little ’ in there, and it’s the having something (anything) in
there which is causing us issues.


Any other ideas?

Cheers
AndyC


On Mar 16, 6:02 am, Paul Van der Eijk wrote:

Andy,

See below using a single quote. Not sure how the email deals with the quote,
but I wrote EpsOut=. This also works on the command line
without an @ file

–Paul

====================
set i /i1*i2/;
parameter A(i) /i1=1, i2=Eps/;

$onecho > task.txt
EpsOut=’
par=A rng=A1
$offecho

execute_unload “test.gdx”, A;
execute “gdxxrw test.gdx o=test.xlsx @task.txt”;

On Mon, Mar 14, 2011 at 7:51 PM, AC wrote:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.

Thanks
AndyC


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


Paul van der Eijk
GAMS Development Corporation
Tel :frowning:202) 342-0180begin_of_the_skype_highlighting (202) 342-0180 end_of_the_skype_highlighting Fax : (202) 342-0181
Email: pvandere...@gams.com
Web :http://www.gams.com- Hide quoted text -

  • Show quoted text -


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

as i was facing a similar problem and found a solution to the problem just now…here´s the link to where i found it finally!:

http://support.gams.com/doku.php?id=interfaces:export_of_all_elements_of_the_solution_including_zero-elements_to_gdx_and_excel



Am Dienstag, 15. März 2011 00:51:40 UTC+1 schrieb AC:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.


Thanks
AndyC

\

To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/dTwqCpO8DdQJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi all,

my question is the exact opposite. I am trying to have the gdx export all zeros to excel. I have tried different approaches but im just not getting there.

Is it only possible for parameters, or also for variables?

This is, among others, what ive tried:


x.l(i,t)$(NOT x.l(i,t)) = eps

execute ‘gdxxrw.exe Results.gdx var=x.l rng=range!a1 SQ=N EpsOut=0’


Thanks for any help…
Felix


Am Dienstag, 15. März 2011 00:51:40 UTC+1 schrieb AC:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.


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.

\

EpsOut applies to what follows; so try:

execute ‘gdxxrw.exe Results.gdx EpsOut=0 var=x.l rng=range!a1 SQ=N’;

–Paul




On Tue, Jun 4, 2013 at 3:32 PM, FelDus wrote:

Hi all,

my question is the exact opposite. I am trying to have the gdx export all zeros to excel. I have tried different approaches but im just not getting there.

Is it only possible for parameters, or also for variables?

This is, among others, what ive tried:


x.l(i,t)$(NOT x.l(i,t)) = eps

execute ‘gdxxrw.exe Results.gdx var=x.l rng=range!a1 SQ=N EpsOut=0’


Thanks for any help…
Felix


Am Dienstag, 15. März 2011 00:51:40 UTC+1 schrieb AC:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.


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.





\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com


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.

\

Paul,

it worked, Thank you so much for the quick response!

Am Dienstag, 4. Juni 2013 22:24:22 UTC+2 schrieb Paul Van der Eijk:

EpsOut applies to what follows; so try:

execute ‘gdxxrw.exe Results.gdx EpsOut=0 var=x.l rng=range!a1 SQ=N’;

–Paul




On Tue, Jun 4, 2013 at 3:32 PM, FelDus wrote:

Hi all,

my question is the exact opposite. I am trying to have the gdx export all zeros to excel. I have tried different approaches but im just not getting there.

Is it only possible for parameters, or also for variables?

This is, among others, what ive tried:


x.l(i,t)$(NOT x.l(i,t)) = eps

execute ‘gdxxrw.exe Results.gdx var=x.l rng=range!a1 SQ=N EpsOut=0’


Thanks for any help…
Felix


Am Dienstag, 15. März 2011 00:51:40 UTC+1 schrieb AC:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.


Thanks
AndyC

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.

To post to this group, send email to gams...@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.





\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvand...@gams.com
Web : http://www.gams.com


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.

\

Hi all,

I had the same problem (get all values 0 into excel) and with your advices it worked! Thanks!

x.l(i,t)$(NOT x.l(i,t)) = eps
execute ‘gdxxrw.exe Results.gdx EpsOut=0 var=x.l rng=range!a1 SQ=N’

Unfortunately it works just for one variable. If I apply the same code to the other variables I need to export into excel… I get an error.

Is it possible to use this order just for one variable or am I doing something wrong?

Thanks!

Paolo

Il giorno martedì 4 giugno 2013 22:24:22 UTC+2, Paul Van der Eijk ha scritto:

EpsOut applies to what follows; so try:

execute ‘gdxxrw.exe Results.gdx EpsOut=0 var=x.l rng=range!a1 SQ=N’;

–Paul




On Tue, Jun 4, 2013 at 3:32 PM, FelDus wrote:

Hi all,

my question is the exact opposite. I am trying to have the gdx export all zeros to excel. I have tried different approaches but im just not getting there.

Is it only possible for parameters, or also for variables?

This is, among others, what ive tried:


x.l(i,t)$(NOT x.l(i,t)) = eps

execute ‘gdxxrw.exe Results.gdx var=x.l rng=range!a1 SQ=N EpsOut=0’


Thanks for any help…
Felix


Am Dienstag, 15. März 2011 00:51:40 UTC+1 schrieb AC:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.


Thanks
AndyC

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.

To post to this group, send email to gams...@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.





\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvand...@gams.com
Web : http://www.gams.com


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.
For more options, visit https://groups.google.com/groups/opt_out.

\

Hi all,

I have the same problem (get all 0 values when exporting into excel) and thanks to your advices I almost solved it.

Unfortunately I managed to apply this code just to one variable. It does not work If I use also for others variables I need to export… and I get an error.

x.l(i,t)$(NOT x.l(i,t)) = eps
execute ‘gdxxrw.exe Results.gdx EpsOut=0 var=x.l rng=range!a1 SQ=N’

Am I doing something wrong or this instruction is possible just for one element and not for all those I would like to display and export?

Thanks for your help!
Paolo

Il giorno martedì 4 giugno 2013 22:24:22 UTC+2, Paul Van der Eijk ha scritto:

EpsOut applies to what follows; so try:

execute ‘gdxxrw.exe Results.gdx EpsOut=0 var=x.l rng=range!a1 SQ=N’;

–Paul




On Tue, Jun 4, 2013 at 3:32 PM, FelDus wrote:

Hi all,

my question is the exact opposite. I am trying to have the gdx export all zeros to excel. I have tried different approaches but im just not getting there.

Is it only possible for parameters, or also for variables?

This is, among others, what ive tried:


x.l(i,t)$(NOT x.l(i,t)) = eps

execute ‘gdxxrw.exe Results.gdx var=x.l rng=range!a1 SQ=N EpsOut=0’


Thanks for any help…
Felix


Am Dienstag, 15. März 2011 00:51:40 UTC+1 schrieb AC:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.


Thanks
AndyC

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.

To post to this group, send email to gams...@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.





\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvand...@gams.com
Web : http://www.gams.com


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.
For more options, visit https://groups.google.com/groups/opt_out.

\

Dear all,

I had a comparable problem where I wanted to write data to an excel file including the zero values. I made many tests based on the example in the gamswiki. However, there are some advantages and disadvantages attached to the different options. Especially with large data files it is not an option to use the variable export with squeeze=n. This will result in a gigantic excel file since excel will also save the zero’s.
Therefore, I used the parameter option writing the zero to only one row and colum of my large matrix. This option works for my own use, but as soon as I give the data to others they ask why there are zero’s in these columns. The sugestion to write text cells by epsout=’ will work, but one runs into problems when calculations are being made with these text cells. Therefore I was looking for a method to write completely empty cells to excel. The following example will exactly do this. Please not that the epsout=‘’ is not a double quote but two single quotes. Thus: epsout= =(single quote)(single quote).

This is the example code:


set i / 1*2/;
positive variable x(i), x2(i);
x.l(‘1’)=0;
x.l(‘2’)=1;
x2.l(‘1’)=0;
x2.l(‘2’)=1;

parameter y(i);
y(‘1’)=eps;
y(‘2’)=1;

  • This will only export x(‘2’);
  • Force the creation of x2(‘1’)
    x2.scale(i) = 0.1;
    execute_unload ‘x1’ x.l, x2.l, y;

Execute ‘gdxxrw x1.gdx o=x.xls Squeeze=N var=x.l rng=x!a1 dim=1’;
Execute ‘gdxxrw x1.gdx o=x.xls Squeeze=N var=x2.l rng=x!a5 dim=1’;
Execute 'gdxxrw x1.gdx o=x.xls epsout=0 par=y rng=x!a10 dim=1 ';

$onecho > task.txt
epsout= =‘’
par=y rng=x!a15 dim=1
$offecho

Execute ‘gdxxrw x1.gdx o=x.xls @task.txt’;


kind regards,
Mark Thissen




Op dinsdag 4 juni 2013 22:24:22 UTC+2 schreef Paul Van der Eijk:

EpsOut applies to what follows; so try:

execute ‘gdxxrw.exe Results.gdx EpsOut=0 var=x.l rng=range!a1 SQ=N’;

–Paul




On Tue, Jun 4, 2013 at 3:32 PM, FelDus wrote:

Hi all,

my question is the exact opposite. I am trying to have the gdx export all zeros to excel. I have tried different approaches but im just not getting there.

Is it only possible for parameters, or also for variables?

This is, among others, what ive tried:


x.l(i,t)$(NOT x.l(i,t)) = eps

execute ‘gdxxrw.exe Results.gdx var=x.l rng=range!a1 SQ=N EpsOut=0’


Thanks for any help…
Felix


Am Dienstag, 15. März 2011 00:51:40 UTC+1 schrieb AC:

We output some values from GAMS into Excel using the gdxxrw command.

We want to guarantee we get a ‘full’ set of outputs, even if the data
is zero or empty.

Normally in GAMS we set the zero values to eps, and use the option
EpsOut = 0 when exporting the data. This replaces each eps value with
0 in Excel.

We now however want to output a BLANK or empty cell rather than zero.
Having the value 0 in these particular cell is causing us some
headaches we want to avoid.

Is there a way to do this?

We tried EpsOut = “” but it complains that this is not valid.


Thanks
AndyC

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.

To post to this group, send email to gams...@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.





\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvand...@gams.com
Web : http://www.gams.com


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.
For more options, visit https://groups.google.com/d/optout.