【发布时间】:2018-07-13 20:08:49
【问题描述】:
我有一些代码可以读取名称文件并创建一个列表:
let who-file-name "world-health-field-surveillance.csv"
let who-file-name-dict csv:from-file who-file-name
let who-file-names sort [who] of names
let index 1 ;not 0, this removes the header in the csv
repeat length who-file-names [
file-open "world-health-field-surveillance.csv"
if file-at-end? [stop]
let entry (item 0 (item index who-file-name-dict))
if entry = "\n" [stop]
文件可能以一些空行结尾,或者文件名称可能由换行符分隔,如下所示:
Allman
Atkinson
Behlendorf
我想忽略任何只包含空格的行。
我的示例代码不起作用。 我怎么能在 netlogo 中做到这一点?
【问题讨论】:
标签: netlogo