If you want to turn the CSV text into a string, you can either find CSV
decoders, or take a look at "split-with"
kl. 11:07:58 UTC+1 fredag 12. desember 2014 skrev Mathias Picker følgende:
>
> Hi all,
>
> a short question from a newbie. I have a data structure like:
>
> "mytitle1"; "2015-02-01"
> "mytitle2"; "2015-03-12"
> "";2015-03-28"
> "mytitle3; "2015-01-12"
>
> and want something like this
>
> [{:title "mytitle1" :events [{:date "2015-02-01}]}
> {:title "mytitle2" :events [{:date "2015-03-12"} {:date "2015-03-28"}]}
> {:title "mytitle3" :events [{:date "2015-01-12"}]}]
>
> I can recurse through the csv manually, but I have a dim feeling this
> might be a job for reduce, but can't wrap my head around it...
>
> Can anyone give me a hint if and how this could be done? Or just tell me
> that I'm mistaken?
>
> If I'm wrong about reduce, anything which uses part of the standard lib to
> make this a more elegant solution would be interesting.
>
>
> Thanks,
>
> Mathias
>
--
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
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.