I am a new user of NetLogo and would like to pose a question to one of the
functions of the csv-extension.
My code seems like the following:
extensions [ csv ]
globals [ x y z ]
... ;; this code isn´t relevant for this topic
set x csv:from-row file-read-line
set y random 100
set z x - y
ifelse z < 10 [
set z 5 ] [
set z 20 ]
If I start the go-procedure, I will get the Runtime-Error "- expected input
to be a number but got the list  instead".
Does anyone have an idea how the problem can be solved?
I am also interested in contact to other modelers. I have started to build a
model referring to the energysystem analyses and would welcome the
opportunity to exchange experiences.
It looks like your problem is that `x` is read in as a list, but you then use it as a single number in your `set z x - y` statement. `csv:read:from-row` always produces a list, even if the row contains only a single number, so if the line in the file contained something like a single "2", the `csv:from-row` command would yield a list with a single element, . To get at that element, you might use `set x first x`.
From your code, it looks like your CSV file is just one number per row,
yes? Since CSV normally has a list of values on each row `csv:from-row`
returns a list. If you only want the first (and only) value in it, just do: