Hi everyone, I’m a economics students and I’m trying to export data from excel to GAMS but
indata.xlsx (8.17 KB)
couldn’t export. I’m attaching a GAMS code which I tried to export data from excel.
Kindly help.
textexcel1.log (1.61 KB)
textexcel1.gms (219 Bytes)
Two mistakes.
- File extension .xlxs instead of .xlsx
- You should not indent $call and $gdxin. Remove the space behind it
After fixing, the following code works
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