Coming in late in this ongoing thread...
Can't you use one of the custom tags pout there that already does CSV to
Query conversion?


http://www.emerle.net/programming/csv2query.cfm


I'm sure there are others and I've used them without hassle in the past
(cheers to whoever coded it in the first place!)


-dc

-----Original Message-----
From: ColdFusion Programmer [mailto:[EMAIL PROTECTED]
Sent: 09 October 2003 10:43
To: CF-Talk
Subject: Re:Looping through a list, setting each listItem to a column

I'm afraid it does not work. I replaced my script with yours and it
did'nt work. There is one column which contains commas in it, I want to
escape the comma, I have made an effort, but I can't get my head round
it which is why I'm asking for other people's help. Here is an example

2003/09/09 14:49:05, "TestUser1", "/Doc/News/Budgeting,Forecasting &
Reporting.doc", "OK"

As you can see the string "/Doc/News/Budgeting,Forecasting &
Reporting.doc" has a comma in it, I want to escape it.

Thanks for your help

>The script wasn't meant to give you a regexp to replace the commas. It
>does the entire job of creating the query and takes the " as a
>qualifier into consideration. Replace your script by mine and it
>should work.
>
> -----Oorspronkelijk bericht-----
> Van: ColdFusion Programmer [mailto:[EMAIL PROTECTED]
> Verzonden: wo 8/10/2003 17:32
> Aan: CF-Talk
> CC:
> Onderwerp: Re:Looping through a list, setting each listItem to a
>column
>
>
> I've tried that and it does not work. Here is my code
>
> <cfscript>
> myList = '2003/09/09 14:49:05, "TestUser1", "/Doc/News/Budgeting,
>Forecasting & Reporting.doc", "OK"';
> myList = REReplace(myList, '^[[:space:]]*([^,
>]*|"([^"]|"")*")[[:space:]]*(,|$)','');
> </cfscript>
> <cfoutput>#myList#</cfoutput>
>
> >This should do it in CF using regexp.
> >There are probably custom tags that will read logs more efficiently
>
> >though.

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to