Dear GAMS users,
Could anyone tell me how I can use GDX to export from GAMS to excel with a loop?
Originally, I was using PUT to export to Excel:
LOOP (UNIT,
PUT UNIT.TL,EFP1(UNIT,UNIT),EFD1(UNIT),SSP(UNIT),SSD(UNIT),SSS(UNIT)/;
);
But I would like to use execute_unload for the same purpose, since this allows me to specify the export location on the spreadsheet.
Here is my attempt that did not work.
execute_unload “untitled.gdx” LOOP ((UNIT),UNIT.TL,EFP1(UNIT,UNIT),EFD1(UNIT),SSP(UNIT),SSD(UNIT),SSS(UNIT)/;);
Thanks in advance,
E.
–
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/KBeYxA-8dL8J.
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 Carlos,
If I were you I would define a parameter and append the data in that parameter in the loop. After the loop you just need to restore that parameter in the excel file. You know calling GDX in the loop is kind of time killing. In this way you just call GDX one time.
On Friday, October 2, 2015 at 2:00:34 AM UTC-5, Carlos wrote:
Dear GAMS users,
Could anyone tell me how I can use GDX to export from GAMS to excel with a loop?
Originally, I was using PUT to export to Excel:
LOOP (UNIT,
PUT UNIT.TL,EFP1(UNIT,UNIT),EFD1(UNIT),SSP(UNIT),SSD(UNIT),SSS(UNIT)/;
);
But I would like to use execute_unload for the same purpose, since this allows me to specify the export location on the spreadsheet.
Here is my attempt that did not work.
execute_unload “untitled.gdx” LOOP ((UNIT),UNIT.TL,EFP1(UNIT,UNIT),EFD1(UNIT),SSP(UNIT),SSD(UNIT),SSS(UNIT)/;);
–
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.
Carlos,
I do not understand what you are trying to do with the execute_unload loop, but to answer your original question, the GDXXRW utility facilitates data transfer between Excel and Ga. The execute_unload function only outputs data in GDX format.
On Friday, October 2, 2015 at 3:00:34 AM UTC-4, Carlos wrote:
Dear GAMS users,
Could anyone tell me how I can use GDX to export from GAMS to excel with a loop?
Originally, I was using PUT to export to Excel:
LOOP (UNIT,
PUT UNIT.TL,EFP1(UNIT,UNIT),EFD1(UNIT),SSP(UNIT),SSD(UNIT),SSS(UNIT)/;
);
But I would like to use execute_unload for the same purpose, since this allows me to specify the export location on the spreadsheet.
Here is my attempt that did not work.
execute_unload “untitled.gdx” LOOP ((UNIT),UNIT.TL,EFP1(UNIT,UNIT),EFD1(UNIT),SSP(UNIT),SSD(UNIT),SSS(UNIT)/;);
–
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.