Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFILE - Write help

Status
Not open for further replies.

kloner

Programmer
May 15, 2000
79
AU
Hi all. I have a set of results for example as :

Yr1 YR2 YR3
TOPIC 1 aaa bbbb ccc
TOPIC 2 aaa bbbb ccc
TOPIC 3 aaa bbbb ccc

and i want to save the results into a temp file for the user to download when they see the results on screen. would like a text file.


<cfloop index=&quot;x&quot; from=1 to=#no_month#>
<cfoutput>#MonthAsString(Month(current_date))#<br>#Year(current_date)#</cfoutput>
<cfset current_date = #DateAdd(&quot;m&quot;, 1, current_date)#>
</cfloop>

<cfoutput query=&quot;topics&quot;>
#topic_name#
<cfloop index=&quot;x&quot; from=1 to=#no_month#>
#result_array[z][x]#
</cfloop>
<cfset z=z+1>
</cfoutput>


The above code gives me the results, but how would i save all that to a file? thanks for any help.
 
I'm still a newbie to CF . . . but I'll give it a shot:

<cfloop index=&quot;x&quot; from=1 to=#no_month#>
<cfoutput>
#MonthAsString(Month(current_date))#<br>
#Year(current_date)#
</cfoutput>
<cfset current_date = #DateAdd(&quot;m&quot;, 1, current_date)#>
</cfloop>

<cfoutput query=&quot;topics&quot;>
#topic_name#
<cfloop index=&quot;x&quot; from=1 to=#no_month#>
#result_array[z][x]#
</cfloop>
<cfset z=z+1>
<CFFILE ACTION=&quot;WRITE&quot; FILE=&quot;C:\the\local\filename.txt&quot;
OUTPUT=&quot;#result_array[z][x]#&quot;>
</cfoutput>

I think I'm wrong . . . but I hope it helps,
-NeoTurtle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top