I don't understand how to use it, can you post an example?

I have tried everything and have gotten it to work under circumstances
I'm not sure of. However it doesn't work now.


(ns progs.netflix.parsing
    (:require (progs.netflix [pg :as pg]))
    (:import (java.sql Date)))
(load-file "C:/clojure/user.clj")

(defn str-to-date [string]
  (let [[y m d] (map #(Integer. %) (split string "-"))]
    (Date. (- y 1900) (dec m) d)))

(defn parse-reviews [path]
  (let [string (slurp path)
        movieid (Integer. (str (reduce str (take-while #(not= % \:)
string))))]
    (loop [[x & xs] (drop 1 (map #(split % ",") (split string "\n")))
           acc []]
      (if (nil? x)
        acc
        (recur xs (conj acc [(first x)
                             movieid
                             (.replace (nth x 2) "\r" "")
                             ;;(str-to-date (.replace (nth x 2) "\r" ""))
                             (Integer. (second x))]))))))

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to