Page 1 of 1
Exporting data from Excel to GAMS
Posted: Thu Apr 22, 2021 6:18 pm
by bhavya_18
Hi everyone, I'm a economics students and I'm trying to export data from excel to GAMS but
couldn't export. I'm attaching a GAMS code which I tried to export data from excel.
Kindly help.
Re: Exporting data from Excel to GAMS
Posted: Thu Apr 22, 2021 10:32 pm
by abhosekar
Two mistakes.
1. File extension .xlxs instead of .xlsx
2. You should not indent $call and $gdxin. Remove the space behind it
After fixing, the following code works
Code: Select all
set r row labels /r1,r2/
c coloumn labels/c1,c2/;
Parameter p(r,c);
$call GDXXRW indata.xlsx trace=3 par=p rng=sheet1!a1 rdim=1 cdim=1
$GDXIN indata.gdx
$load p
$GDXIN
Display p;
- Atharv