Re: str-utils change proposal, round 2

2009-05-14 Thread Daniel Lyons
> I'm doing the same. I cannot judge the quality of OpenCVS but up to > now I had no problems. I thought about using fnparse to build a > clojure > CSV parser, but I'm not sure how hard this would be. Let's see with > what Stuart comes up. CSV parsing is a headache because there are so many imp

Re: str-utils change proposal, round 2

2009-05-14 Thread Wilson MacGyver
it sounds like what I'm looking for will be served by Stu's csv parser in clojure. the other need that comes to mind was stripping the annoying Microsoft's "smart quote" characters. ie, replace them with regular quote marks. This came to mind because I saw your string functions have html escapin

Re: str-utils change proposal, round 2

2009-05-14 Thread Meikel Brandmeyer
Hi, Am 14.05.2009 um 17:12 schrieb Daniel Lyons: That would be wonderful. I have wrapped OpenCSV for my own purposes but would of course prefer not having another library dependency. My code wound up like this: (import 'java.io.FileReader 'au.com.bytecode.opencsv.CSVReader)) (defn read-csv [

Re: str-utils change proposal, round 2

2009-05-14 Thread Sean Devlin
Hmmm... it sounds like there would be use for a "string table utils" or something like that. On May 14, 11:12 am, Daniel Lyons wrote: > On May 14, 2009, at 7:14 AM, Stuart Halloway wrote: > > > > > FYI: I am working on an open-source CSV parser in Clojure. Splitting > > on delimiters is rarely e

Re: str-utils change proposal, round 2

2009-05-14 Thread Daniel Lyons
On May 14, 2009, at 7:14 AM, Stuart Halloway wrote: > > FYI: I am working on an open-source CSV parser in Clojure. Splitting > on delimiters is rarely enough in my experience. That would be wonderful. I have wrapped OpenCSV for my own purposes but would of course prefer not having another li

Re: str-utils change proposal, round 2

2009-05-14 Thread Sean Devlin
Stuart, Excellent point about delimiters, parsing CSV is much more sophisticated than my simple s-exp. However, since you're writing a parser you've worked with strings a lot :) I use something like str-take/str-drop all the time in my parsers. So if you could answer a few questions... 1. Wo

Re: str-utils change proposal, round 2

2009-05-14 Thread Stuart Halloway
FYI: I am working on an open-source CSV parser in Clojure. Splitting on delimiters is rarely enough in my experience. Stu > 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

Re: str-utils change proposal, round 2

2009-05-14 Thread Sean Devlin
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 manipu

Re: str-utils change proposal, round 2

2009-05-14 Thread Wilson MacGyver
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 wrote: > > Hello again everyone

str-utils change proposal, round 2

2009-05-13 Thread Sean Devlin
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/42152add46b851a0# Github: http://github.com/francoisde