Theres a custom tag called CFX_CSVToQuery... cant remember off hand 
where i got it... probably from the Dev Exchange but can send it to you 
off-list if you want...

This takes a CSV file and converts it into a CFQuery Object..

This handles commas in the fields (assuming they are within quotations i 
beleive)

HTH



Kay Smoljak wrote:

> OK... So I have each record (line) of the CSV in a separate list. I now
> need to loop over each record (list) and pull the individual fields out.
> In order to change the commas to pipes, I'd have to know which ones to
> change and which ones not to, no?
> 
> The only way I can think of involves lots of regexes, which
> unfortunately I'm not good at. I was thinking I could go through the
> list and find a single double-quote. Then keep looking until I find
> another single double-quote (there are double quotes within the string,
> but they are escaped ie 'she said ""hello"" to him'). Then change all
> the commas within that field to pipes, loop over and pull them into a
> structure, then change all the pipes back to commas. Whew. I have no
> idea where to start.
> 
> Bud, I think that having a list qualifier parameter would be much much
> simpler!
> 
> Kay.
> 
> P.S. In case I'm not being clear here, a single record looks like this:
> 
> 11,Apollo 13,Drama,"It had been less than a year since man first walked
> on the moon, but as far as the American Public was concerned, Apollo 13
> was just another ""routine"" space flight - until these words pierced
> the immense void of space: ""Houston we have a problem."" Ron Howard
> directs Academy Award winner Tom Hanks, Kevin Bacon, Bill Paxton, Gary
> Sinise and Ed Harris in a riveting suspense-thriller from Imagine
> Entertainment.",18/08/1999 
> 
> 
> 
> 
> "Bud" <[EMAIL PROTECTED]> wrote in message
> news:<p04320409b9049fb704b0@[192.168.0.1]>...
> 
>>On 5/12/02, Reuben Poon penned:
>>
>>>Kay,
>>>
>>>You could try this (written in psudo-code)
>>>
>>>1 replace "," with ||
>>>2 loop through items using , as delimiter
>>>3 set || back to ","
>>>
>>>This would remove the problem with the multiple commas and seems to 
>>>be a relatively easy solution.  You should only have to add two lines
>>>
> 
>>>of code (#1 and #3).
>>>
>>Actually, you've got the right idea, but I think you should have said
>>to change "," to | then use | as the delimiter, then change the | 
>>back to ",".
>>-- 
>>
>>Bud Schneehagen - Tropical Web Creations
>>
>>_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>>ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED]
>>http://www.twcreations.com/
>>954.721.3452
>>
>>
> 
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to