编辑:
我的问题是如何过滤掉 zipmap 中似乎是空白键的内容?
尽管我有解决问题的方法,但知道如何过滤密钥会很有帮助。
结束编辑:
这个输出
: [: [ ]] ([ ]) 3 ,,
由
(println first-ent, " ", map-ent, " ", val-ent, " ", (count out-csv), " ", out-csv)
在这个函数中
(defn missing-accts
"Prints accounts found in one report but not the other."
[report-header mapped-data out-file]
(spit out-file (str "\n\n" report-header "\n\n") :append true)
(doseq [map-ent mapped-data]
(let [first-ent (first map-ent)
val-ent (rest map-ent)
out-csv (if first-ent
(str (name (key map-ent)) "," (first (val map-ent)) "," (last (val map-ent)) "\n")
nil)]
(println first-ent, " ", map-ent, " ", val-ent, " ", (count out-csv), " ", out-csv)
(if (> (count out-csv) 3)
(spit out-file out-csv :append true)
(println "Skipping: ", out-csv)))))
带有空白键的输出的计数为 3 的事实使我可以进行过滤,这一事实似乎不像能够检测到空白键那样干净。找到并过滤掉一个空白键是让我难过的地方。
谢谢你。