techman36
asked on
writing a recordset to a text file
I want to write data to a text file. I want to be able to control how the data will look in the text file so I was thinking of using recorddset fields and putting it all in one CF variable string and use cffile to output that one variable. I guess I want to know how to put all my data from my query into a single string variable.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use the following:
<cfsavecontent variable="contentvar">
<cfoutput>text
text and more text. and formatting
</cfoutput>
</cfsavecontent>
<cffile action = "write"
file = "c:\output\"
output = "#contentvar#"
mode = "777"
attributes="normal">
<cfsavecontent variable="contentvar">
<cfoutput>text
text and more text. and formatting
</cfoutput>
</cfsavecontent>
<cffile action = "write"
file = "c:\output\"
output = "#contentvar#"
mode = "777"
attributes="normal">
https://www.experts-exchange.com/questions/20752794/How-can-I-write-a-CF-query-to-a-Text-file.html?qid=20752794