I am trying to load data from a csv file (attached) using the following command:
set
i /1*1001/
;
parameter x(i)/
$ondelim
$include Data.csv
$offdelim
/;
The file has only 1001 data points. However, I am getting the following message in GAMS:
error 465 Too much data on this line - rest ignored. Any suggestion on fixing this error is much appreciated.
Data.csv (5.75 KB)
Hi,
You are not using proper GAMS syntax. You miss the indices and also it seems that you do not need $ondelim.
The following code snippet illustrates how your data should be formatted (with or withour $ondelim)
parameter x(i)/
1 2, 2 2.003, 3 2.006, 4 2.009
/;
parameter xx(i)/
$ondelim
1,2
2,2.003
3,2.006
4,2.009
$offdelim
/;
I suggest to have a look at the documentation: https://www.gams.com/latest/docs/UG_DataExchange_ASCII.html
I hope this helps!
Fred