Check out the section called "Building a query from a delimited text file"
in the CFHTTP docs and see if it helps at all...

http://livedocs.macromedia.com/cf50docs/CFML_Reference/Tags47.jsp

-Cameron

-----------------
Cameron Childress
On Contract at BioLab Inc.
---
cell:  678-637-5072
aim:   cameroncf
email: [EMAIL PROTECTED]


> -----Original Message-----
> From: Kay Smoljak [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 12, 2002 12:52 PM
> To: CF-Talk
> Subject: list delimiters
>
>
> I'm trying to import a CSV, do some fiddling with it, then save it off
> as a file again. Some of the fields contain commas within them, so these
> fields are all enclosed in double quotes. I am reading in the file like
> this:
>
> <cffile action="read" file="c:\inetpub\wwwroot\test.csv"
> variable="origCSV">
> <cfset temp = StructNew()>
>
> then looping over it like this:
>
> <cfset counter = 0>
> <cfloop list="#origCSV#" index="w" delimiters="#chr(10)##chr(13)#">
>       <cfset counter = counter + 1>
>       <cfset temp[counter] = StructNew()>
>       <cfset temp[counter].raw = w>
>       <cfset counter2 = 0>
>               <cfloop list="id,title,blurb,ReleaseDate" index="q">
>                       <cfset counter2 = counter2 + 1>
>                       <cfset temp[counter][q] =
> ListGetAt(temp[counter].raw,counter2,",")>
>               </cfloop>
> </cfloop>
>
> Which is fine, except it's not taking into account commas that appear in
> the title or blurb fields. I'm sure there's a simple answer, but I'm at
> a loss to see it. Any ideas?
>
> Thanks heaps,
> Kay.
> ______________________________________
> Kay Smoljak              Web Developer
> Custom Tags: developer.perthweb.com.au
>
> 
______________________________________________________________________
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to