Fixed width file parser. Code adapted from http://www.lexicallyscoped.com/2015/01/05/parsing-flat-files-in-clojure.html.
(def parse-rules {:cols [{:name :company :slice [0 62]} {:name :form :slice [62 74]} {:name :cik :slice [74 86] :type :long} {:name :date :slice [86 98] :type :date} {:name :file :slice [98]}] :skip-lines 10 :skip-line? (some-fn str/blank? (partial re-seq #"^-+$"))})
Fixed width file parser. Code adapted from http://www.lexicallyscoped.com/2015/01/05/parsing-flat-files-in-clojure.html. (def parse-rules {:cols [{:name :company :slice [0 62]} {:name :form :slice [62 74]} {:name :cik :slice [74 86] :type :long} {:name :date :slice [86 98] :type :date} {:name :file :slice [98]}] :skip-lines 10 :skip-line? (some-fn str/blank? (partial re-seq #"^-+$"))})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close