Skip to content

Instantly share code, notes, and snippets.

@andrewberls
Created October 1, 2015 23:42

Revisions

  1. andrewberls created this gist Oct 1, 2015.
    13 changes: 13 additions & 0 deletions btable.clj
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    (require '[clj-btable.core :as btable])

    (def labels ["Login" "View_Cat_Food" "Purchase_Cat_Food"])
    (def rows [[5.0 3.0 1.0] [2.0 0.0 0.0] [0.0 0.0 0.0]])

    (btable/write "out.btable" labels rows)
    ; => #<File out.btable>

    (btable/labels "out.btable")
    ; => ["Login" "View_Cat_Food" "Purchase_Cat_Food"]

    (doseq [row (btable/rows "out.btable")]
    (process-row row)) ; Process a single row in a lazy sequence of rows