Does not get any simpler than apache commons lang CSV 
StringTokenizer.getCSVInstance() which is intelligent enough to understand 
Excel type CSV with delimiters when there is commas inside the token and no 
delimiters when there is no commas. It also escapes quotes IIRC.

http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/text/StrTokenizer.html

Also of relevance for CSV processing are:

http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/StringEscapeUtils.html
   .unescapeCsv(.....)

http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/StringEscapeUtils.html
   escapeCsv(....)

-Kieran

PS. Mike, if there was ever another generic jar that Anjo was willing to allow 
into ERJars it should be apache commons lang extensions. Totally useful and 
commonly desired extensions to the java language and saves a lot of reinventing 
the wheel :-)

They even have something like ERXSimpleTemplateParser that uses ${argname} 
style variables:
http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/text/StrSubstitutor.html


On Aug 31, 2010, at 2:40 PM, Joe Moreno wrote:

> Can anyone recommend a simple CSV file reader for WO?
> 
> It needs to be smart enough to escape commas inside quotes, i.e.:
> Name, Location
> John Smith, "Cupertino, CA"
> 
> I'm sure that this wouldn't be hard to write, but code I don't have to write 
> is code that I don't have to debug. :^D
> 
> Many thanks,
> Joe
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists%40mac.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to