Hi,
I am working on reading a pipe delimited file into a SQL database.
I can read the lines using
(doseq [line (read-lines "myfile.csv")]
and format the lines using
(map #(format "\"%s\"" %) (re-split #"\|" line))
This results in list for each line.
I have created a table that has one column for each value in the list.
The values are like ("mark" "stang" "employee").
What I can figure out is how to "convert" the list into something that
can be passed to insert-rows.
The error I get is that "insert into mytable values ()" I have tried
converting the row into a vector
(vec (map #(format "\"%s\"" %) (re-split #"\|" line)))
Which when I print it, it looks like ["mark" "stang" "employee"] but the
insert-rows function isn't seeing it. I have tried doing a let for each
line and passing the name, but no such luck.
It seems that I could get it to work with insert-values, but that seems
like a lot of overhead.
I would think I should be able to call insert-rows with the results of
reading the entire file.
Thoughts?
Thanks,
Mark
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en