Ooops see inline...

Also, if you wanted to change the delimiiter, it's not a big deal - just
change the "," and remove the double quotes from around the field and put in
whatever you want.

Also, an excel xml download is very nice (as Tomo said).

> Try this:
> 
> <cfquery name="myQuery" datasource="#dsn#">
> SELECT *
> FROM myTable
> </cfquery>
> 
> <!--- create the dumpvar --->
> <cfset dumpvar = "">
> 
> <!--- output the column list as the first line --->
> <cfset counter = 1>
> <cfloop list="#myQuery.columnlist#" index="col">
>       <cfset dumpvar = dumpvar & """" & col & """">
>       <cfif counter neq ListLen(myquery.columnlist)>
>               <cfset dumpvar = dumpvar & ",">
>       </cfif>
>       <cfset counter = counter + 1>
> </cfloop>

<cfset dumpvar = dumpvar & chr(13)>

> <!--- loop over the query and output the data (in double 
> quotes, although double quotes are not escaped in the code) 
> ---> <cfloop query="myQuery">
>       <cfset counter = 1>
>       <cfloop list="#myQuery.columnlist#" index="col">
>               <cfset dumpvar = dumpvar & """" & evaluate(col) & """" >
>               <cfif counter neq ListLen(myquery.columnlist)>
>                       <cfset dumpvar = dumpvar & ",">
>               </cfif>
>               <cfset counter = counter + 1>
>       </cfloop>
>       <cfset dumpvar = dumpvar & "#chr(13)#">
> </cfloop>
> 
> <!--- output dumpvar to file ---> 
> <cfoutput><pre>#dumpvar#</pre></cfoutput>
> 
> > 
> > On a deadline : anyone got a CT which can take a query and
> > dump it to a delimited text file (ideally user declared) with 
> > little or no hassle? 
> > 
> > 
> > --
> > ** Archive: 
> http://www.mail-archive.com/dev%> 40lists.cfdeveloper.co.uk/
> > 
> 
> > To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED] For human help, e-mail: 
> > [EMAIL PROTECTED]
> > 
> 
> 
> 
> -- 
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
> 



--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to