<CF_FileWriteText>

For ColdFusion 4.0 and up only.  A simple tag that exploits ColdFusion 4.0's new Custom Tag architecture to allow you to write files to disk quickly and easily using opening and closing <CF_FileWriteText> tags.  You are free to use just about any ColdFusion tags--like CFSET, CFLOOP, CFOUTPUT, or other custom tags--inside this "block".  Good for situations where CFFILE's built-in OUTPUT parameter proves difficult to use. 

Parameters:

FILE
Required.  The file to write to, as a full filesystem-style path (including the c:\, etc).

ACTION
Optional.  WRITE or APPEND.  Defaults to WRITE.  See your docs on CFFILE for details.

Note that everything between the opening and closing tag will be written to disk, including any generated whitespace.  If you want to suspend whitespace output, use the CFSETTING tag between the two CF_FileWriteText tags. 

Example:

<CFQUERY NAME="Hello" DATASOURCE="A2Z">
  SELECT * FROM Customers
</CFQUERY>

<CF_FileWriteText FILE="c:\temp\output.html">

<TABLE>
<TR><TH>FirstName</TH><TH>LastName</TH></TR>
<CFOUTPUT QUERY="Hello">
<TR><TD>#FirstName#</TD><TD>#LastName#</TD></TR>
</CFOUTPUT>
</TABLE>

</CF_FileWriteText>