CFHTTP can make a query out of a CSV file, but ONLY if all of the cells in the file 
have the SAME text delimiters. For example if ALL of the cells have "quotes" around 
the values or if NONE of the cells have "quotes". This rules out any CSV saved by 
Microsoft Excel. Unfortunately this is the source of 99% of the CSV files you will 
need to parse.

What I do is I tell CFHTTP that there are NO text delimiters, then I can make a query 
out of the file. Some of the cells will have extra "quotes" around them. I run each 
and every field of the query through some reg-ex'es to remove a leading " and remove a 
trailing " as I copy them into a temporary table in my database. Then I can manipulate 
the date with real queries.

At 10:48 AM 11/22/00 -0500, Richard Gilbert wrote:
>Greetings!
>
>I am struggling with the notion of trying to query a CSV. For some reason
>CFHTTP does not work for me. And I am also having trouble setting up a csv
>file as a datasource in CF Admin. (verify=failed)
>
>Do any of you know of a custom tag for this purpose?
>
>Thanks in advance,
>Richard
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Structure your ColdFusion code with Fusebox. Get the official book at 
>http://www.fusionauthority.com/bkinfo.cfm
>
>Archives: http://www.mail-archive.com/[email protected]/
>Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists 


---------------------------------------------------------------------------
Peter Theobald, Chief Technology Officer
LiquidStreaming http://www.liquidstreaming.com
[EMAIL PROTECTED]
Phone 1.212.545.1232 x204 Fax 1.212.545.0938

To put this contact information into your Palm device, click here:
http://www.coola.com/cgi-bin/addinfo.cgi?pid=15803&rid=972879910&type=A


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to