HELP: Reading table from CSV

Manuel Castro <[email protected]> Sat, 05 Dec 2020 13:11:11 +0000
Newsgroups gmane.comp.gnu.glpk
Message-ID <[email protected]>
Hi all,



First, I would like to thank you for the constant support as you have always addressed my questions very promptly.

Second, I would like to ask you a question as I am really stuck on this one.



I have defined the following in the code:
set LoadsCount; 

set PeriodsCount;

param LoadPowerProfile{i in LoadsCount, j in PeriodsCount};



For the sake of discussion let's assume that "LoadsCount" is 1..100 and "PeriodsCount" is 1..8760 (i.e. hourly values through the year).

I now want to fill in my array "LoadPowerProfile" with values. For that I have the following table in CSV (of course this is a stylized table just for you to understand what I am up to). 





Load

1

2

(…)

8760


Load1

11.98

62.51

 

99.69


Load2

86.39

59.50

 

25.89


(...)

 

 

 

 


Load100

67.98

98.71

 

31.19






How do I read the yellow shaded area into my "LoadPowerProfile" array? I would be thankful if you could give me an example of the statement i should use to read this into "LoadPowerProfile" array.



Many thanks in advance for all your support.



Kind regards,

Manuel.