set out-list lput (list who ifelse-value (any? link-neighbors) ["true"] ["false"]) out-list
]
]
csv:to-file "output/attribute.csv" out-list
file-close
Each household creates a list of its who number and either "true" or "false", depending on whether it has any link-neighbors. It then appends that list to out-list, giving you a list of lists. The line
csv:to-file "output/attribute.csv" out-list
then writes that list to your file, one sublist to a line. The CSV extension is really handy for reading and writing CSV files. You will use it often. And creating lists for your output lines makes it easy to add or modify the variables you want to write, without having to worry about inserting commas and line feeds.
Hope this helps,
Charles