I couldn't make complete sense of map-expander.
Do you mind explaining it in a bit more detail.
but this did the trick for me..
(defn map-horizontal [m expected-keys]
(into [] (map #(get m %) expected-keys))
)
(defn extract [source expected-keys]
(let [outargs (v/gen-nullable-vars (count expected-keys))]
(<- outargs
(source ?line)
(extract-log ?line :> ?line-
params) ;; extract-log returns a map
(map-horizontal ?line-params expected-keys :>> outargs)
)
)
)
(defn process [output input]
(let [
source (hfs-textline input)
extracted (extract source [:a :b])
]
(?<- (hfs-textline output) [?l ?m]
(extracted ?l ?m))
)
)
Used part of your idea. Thanks :)
--
Thejus
On Jun 2, 2:36 pm, Paul Lam <
paul....@forward.co.uk> wrote:
> I'm guessing you're parsing a delimited text file? If that's true, just use
> TextDelimited in Cascading or its clojure wrapper athttps://
github.com/nathanmarz/cascalog-contrib/blob/master/cascalog.m...