I guess I don't quite see what you're asking for.

If I understand you right, here's how I would do your task today:

(def input-string (slurp "My File.csv"))

;And using my re-split fn...

(re-split input-string '(#"[\r\n]" #","))

This would return a list of rows & cols, and could then be manipulated
appropriately.  You cold even do something like this:

(re-split input-string '({:pattern #"[\r\n]" :offset 1} #","))

And it would drop the first line, as this is usually header
information.

Could you give me an example of what you envision?  What would a high
level call look like?

On May 14, 3:07 am, Wilson MacGyver <wmacgy...@gmail.com> wrote:
> would you consider adding support of a split by passing a delimiter?
> since parsing csv/tsv is a pretty common task.
>
> I know it can be done by using re-split. but it seems to occur
> common enough that it's not a bad idea.
>
>
>
> On Thu, May 14, 2009 at 1:12 AM, Sean Devlin <francoisdev...@gmail.com> wrote:
>
> > Hello again everyone,
> > I've added a few new routines to a string library I've been working
> > on.  I mentioned it about a month ago, as a proposed change to str-
> > utils.
>
> > Original Thread:
> >http://groups.google.com/group/clojure/browse_thread/thread/42152add4...
>
> > Github:
> >http://github.com/francoisdevlin/clojure-str-utils-proposal/tree/master
>
> > Most notable I've created two new functions in this addition,
>
> > str-take
> > str-drop
>
> > They have a simple form
>
> > (str-take 7 "Clojure Is Awesome") = > "Clojure"
> > (str-drop 8 "Clojure Is Awesome") = > "Is Awesome"
>
> > But the can also take a regex
>
> > (str-take #"\s+" "Clojure Is Awesome") = > "Clojure"
> > (str-drop #"\s+" "Clojure Is Awesome") = > "Is Awesome"
>
> > You can check the tests and README.html for more usage.
>
> > I'm looking for feedback.  If anyone else has string functions that I
> > haven't covered, let me know.
>
> > Thanks,
> > Sean
>
> --
> Omnem crede diem tibi diluxisse supremum.
--~--~---------~--~----~------------~-------~--~----~
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