data.csv-附加到CSV(Clojure)中的新线路
我一直在测试此CSV软件包 data.csv 。
我设法将写作写入CSV。我仍然是Clojure/LISP的新手。
我无法(通过测试或通过文档)找出的是如何在CSV中添加数据。
API文档说了这一点:
write-csv
function
Usage: (write-csv writer data & options)
Writes data to writer in CSV-format.
Valid options are
:separator (Default \,)
:quote (Default \")
:quote? (A predicate function which determines if a string should be quoted. Defaults to quoting only when necessary.)
:newline (:lf (default) or :cr+lf)
但是我无法锻炼如何使用它。
我正在尝试为以下代码添加一条新行:
(defn writeCSV [name]
(with-open [writer (io/writer filePath)]
(csv/write-csv writer
[[name 2]])))
name
将添加到下一个可用行中。
I have been testing out this csv package data.csv.
I have managed to make the writing to CSV work. I am still very new to clojure/lisp.
What I cannot figure out (through testing or via the documentation), is how to add the data too a new line in the csv.
The API documentation says this:
write-csv
function
Usage: (write-csv writer data & options)
Writes data to writer in CSV-format.
Valid options are
:separator (Default \,)
:quote (Default \")
:quote? (A predicate function which determines if a string should be quoted. Defaults to quoting only when necessary.)
:newline (:lf (default) or :cr+lf)
But i cannot workout how to use it this.
I am trying to add a new line for the following code:
(defn writeCSV [name]
(with-open [writer (io/writer filePath)]
(csv/write-csv writer
[[name 2]])))
Where the name
is added to the next available line.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
:append
io/writer
的选项:Use the
:append
option ofio/writer
: