CSV file not being read

19 views
Skip to first unread message

Martín Otálora Löw

unread,
Jun 15, 2022, 11:27:13 AM6/15/22
to netlogo-users
Hello, im trying to read a simple excel file saved as CSV. the file in question is just two columns with 19 numbers, no titles. However, im getting a "expected literal value" and i dont know how to solve it as i just have numbers.

The full code is down here. Thanks in advance 

extensions [csv]
globals [ turtle-data ]
 turtles-own [ awareness income housingtype adopt ]
 to setup
  clear-all
  reset-ticks
  create-turtles 20
  ask turtles [
   set color white
  ]
  ask turtles [
   setxy random-xcor random-ycor
  ]
;load-turtle-data
   ; setup-turtles
  load-data
 end

to load-data
  file-open "Ejemplocsv.csv"
  while [not file-at-end?] [
   ask turtles [
      set income file-read
      set housingtype file-read
      set size 1.5]
    ask turtles [setxy random-xcor random-ycor]]

  file-close
  show "file read"

end

Charles Staelin

unread,
Jun 15, 2022, 12:16:43 PM6/15/22
to Martín Otálora Löw, netlogo-users
This question has already been answered over on stackoverflow.

-------------------------------
Charles P. Staelin
Professor Emeritus of Economics
Smith College
Northampton, MA 01063


--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/3a3f57ce-127a-4637-be7d-9652377b66fcn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages