![]() ![]() ℹ️About GitHub Wiki SEE, a search engine enabler for GitHub WikisĪs GitHub blocks most GitHub Wikis from search engines. ![]() Because the delimiter is optional, when you add one you must surround the whole primitive usage with parenthesis. Observer: "1,-3,-2,85,\"hi, how are ya?\"\n0,-4,2,85,\"hi, how are ya?\"\n2,-5,3,65,\"hi, how are ya?\""Īll primitives also accept an optional delimiter argument, which is a string of a single character used to separate individual values. Observer> csv:to-string of turtles convert each turtle into a list of values we want ![]() Observer: "(turtle 0),(turtle 1),(turtle 2)" not very useful Observer> csv:to-string (list (sort turtles) ) I recommend "pre-converting" any complex values you want to retain: observer> create-turtles 3 Complex values like anonymous procedures or turtles will probably not be well-represented. Simple values like numbers, strings, and true/false should all be correctly converted. Only values that can be easily converted to strings will be correctly handled by to-string and to-row. If you're working one row at a time with single lists, you want to-row or from-row: observer> csv:from-row "" Observer: "apples,oranges,1,2\ngreen,red,3,4" Observer> csv:from-string "apples,oranges,1,2\ngreen,red,3,4" If you're working with whole files with data on separate rows, or you want to generate such a file, you want to-string and from-string: observer> csv:from-string "" You can save a CSV file using the SendTo extension, like this: send-to:file "output.csv" csv:to-string (/NetLogo/Tortoise/wiki/0-1-true-"hello"][2-5-true-".") Simple Usage You can get a CSV file using the Fetch extension, like this: fetch:user-file-async
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |