semantic-csv
semantic-csv copied to clipboard
fix: added nil to empty values
I changed the zipmap default method so that it will always create a map with all the passed keys.
Another solution can be:
(defn pad [n coll val]
(take n (concat coll (repeat val))))
(defn mappify-row
"Translates a single row of values into a map of `colname -> val`, given colnames in `header`."
[header row]
(zipmap header (pad (count header) row nil))) ; here we can replace nil with any default value passed by the user
Fixes #65
Thanks for the PR!
See comments in #65; This is great, but would you please make this functionality opt-in only?
Thanks again
There you go, added :preserve-header to the mappify options.