Skip to content

Instantly share code, notes, and snippets.

@j1n3l0
Created February 26, 2014 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j1n3l0/9220865 to your computer and use it in GitHub Desktop.
Save j1n3l0/9220865 to your computer and use it in GitHub Desktop.
(ns example-cascalog.core
(:require [cascalog.api :refer [?<- stdout]]
[clojure.string :refer [split-lines split]]))
(defn slurp-psv
"Slurp a PSV file into a vector of vectors"
[file]
(->> file slurp split-lines (mapv #(split % #"\|"))))
(?<- (stdout)
[?name ?age]
((slurp-psv "/home/j1n3l0/Documents/data.psv") :> ?name _ ?age))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment