chickadee » csv-xml » list->csv

list->csv LS #!optional WRITER-OR-OUTprocedure

LS is a list-of list | string, a list of row-item.

WRITER-OR-OUT is a csv-writer or output-port. Default is the (current-output-port). Note that when an output-port is specified the default csv-writer-spec will be used.

When the current row-item is a string, and not a list, then it is treated as a line-comment. Note that comments are processed only when the associated csv-writer-spec comment-char is a character.

;assumes string output & comment-char is #\#
(list->csv '((1 22 333) "a comment" (11 2222 333333)))
;=> "\"1\",\"22\",\"333\"\n#a comment\n\"11\",\"2222\",\"333333\"\n"