Re: Help: read single value from CSV

2020-11-28 Thread Heinrich Schuchardt
Am 28. November 2020 18:08:01 MEZ schrieb Manuel Castro :
>Hi there,
>
>
>
>What does the syntax statement look like to read a single value from
>the CSV file?
>
>My CSV has the following:
>
>RowIndex   Capacity
>
>   1                   33
>
>
>
>I read it as follows:
>
>param Z {i in I};
>
>table tab_stream IN "CSV" "stream.csv" : [RowIndex], Z ~ Capacity;
>
>

You should use 

[I  ~ RowIndex]

to fill I.

The table statement is meant to rraf multiple lines.

Just define a parameter that is the sum of the capacity array Z.

Best regards

Heinrich


>
>I am only interested in the column 'Capacity', i.e. in the value 33.
>
>More importantly, I don't need Z to be an array. I want Z to be a
>scalar i.e. param Z;
>
>
>How do I represent this in the read statement of the CSV?
>
>
>
>Many thanks.
>
>
>
>Kind regards,
>
>Manuel. 




Help: read single value from CSV

2020-11-28 Thread Manuel Castro
Hi there,



What does the syntax statement look like to read a single value from the CSV 
file?

My CSV has the following:

RowIndex   Capacity

   1                   33



I read it as follows:

param Z {i in I};

table tab_stream IN "CSV" "stream.csv" : [RowIndex], Z ~ Capacity;



I am only interested in the column 'Capacity', i.e. in the value 33.

More importantly, I don't need Z to be an array. I want Z to be a scalar i.e. 
param Z;


How do I represent this in the read statement of the CSV?



Many thanks.



Kind regards,

Manuel.