How do i read in data from csv files into a vector of vectors.
In other words each row would be a vector and each column would be an element inside the vector. It would be like a 2D array [row][col]
您应该简单地使用现有的 csv 库,例如clojure-csv或data.csv。
例如 data.csv 就像
(require '[clojure.data.csv :as csv]
'[clojure.java.io :as io])
(with-open [in-file (io/reader "in-file.csv")]
(doall
(csv/read-csv in-file)))
(示例取自这里)
csv/read-csv
vec
将返回一个惰性向量序列,您可以使用(如果您真的需要)将其转换为字符串向量的向量。