> I #39;m attempting to write a portfolio optimization model in GMPL, > and would like to read return data from a .cvs file. The file would > include a variable number of columns with the column header containing > a short string for the stock ticker symbol.
> I #39;m having trouble figuring out how to read a variable number of > columns in GMPL, then use the column headers as entries in a set. Is > it possible to do this? The only way is to rearrange the csv file structure. Rather than using a multi-field csv file like this: SYMBOL,VALUE1,VALUE2,...,VALUE3 A,0.11,0.12,...,0.13 B,0.21,0.22,...,0.23 you should use the following 3-field csv file: SYMBOL,PARAM,VALUE A,VALUE1,0.11 A,VALUE2,0.12 A,VALUE3,0.13 B,VALUE1,0.21 B,VALUE2,0.22 ... _______________________________________________ Help-glpk mailing list Help-glpk@gnu.org http://lists.gnu.org/mailman/listinfo/help-glpk