On Sun, May 16, 2010 at 10:07 AM, Brian McCairn
<brian.mcca...@medicapp.eu> wrote:
> replace commas with another arbitrary separator?

Doesn't solve the problem.

> <cfset lstText = '"this is one, this is another one", "this should be second 
> item"' />
>
> <cfoutput>#listLen(replacenocase(lsttext,',','||'), '||')#</cfoutput>

That just replaces the first , - in the "string" with || and so you
get a listLen() of 2:

"this is one|| this is another one", "this should be second item"

And multiple characters do not make a single delimiter. You actually
have three elements there but the second - between the two |
characters - is empty and CF ignores empty elements in lists.

As Barney says, use a proper CSV parser that someone has taken the
time and effort to write and debug.
-- 
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333735
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to