Here's how I've done it before

<!--- Insert your query code --->

<cfsavecontent variable="csvText">
    <!--- Insert your loop code to generate your text --->
</cfsavecontent>

<cftry>
 <cffile action="WRITE" file="#csvPath#" output="#csvText#" addnewline="No">
 
 <a href="csv/#csvName#" title="Download your csv file">Download #csvName#</a>
 
 <cfcatch type="Any">
  There was a problem writing
  #csvText#<br>
  to a file
 </cfcatch>
</cftry>


> > -----Original Message-----
> > From: Costas Piliotis [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, June 05, 2003 11:47 AM
> > To: CF-Talk
> > Subject: RE: csv files
> >
> >
> > Here.  Convert query and filename as you like:
> >
> > <cfquery datasource="#application.ds#" name="test">
> > select branchid, branchname from tblbranches
> > </cfquery>
> >
> > <cfoutput query="test">
> > <cfset myvar = "">
> > <cfloop list="#test.columnlist#" index="mycol">
> > <cfset myvar = myvar &", "& evaluate("test." & mycol)>
> > </cfloop>
> > <cfset myvar = right(myvar, len(myvar) - 1)>
> > <cffile action="APPEND" file="\\yvrworptest\worp\test.csv"
> > output="#myvar#">
> > </cfoutput>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to