djew got it mang :)

now, inside that savecontent tag, you can all sorts of stuff, so if you ever
need it again, and want to manipulate data, you can do that as well.

also, its REALLY handy when writing LARGE text files. 1mb+ with lots of
rows, etc...

far better than I used to do it with a one line write each time to the file,
not nice at all, since its filesystem access for each row :(

anyway, VERY NICE for this, later!

tw

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 22, 2004 1:19 PM
To: CF-Talk
Subject: RE: Writing cfoutput to a text file

I got it..
<cfsavecontent variable="ecount_file">
<cfloop query="fetchReferrals">
<cfoutput>#record_data#</cfoutput>
</cfloop>
</cfsavecontent>

-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 22, 2004 11:50 AM
To: CF-Talk
Subject: RE: Writing cfoutput to a text file

so, loop through it, make each field, have a #queryName.column#, value in
the cfsavecontent.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 22, 2004 12:41 PM
To: CF-Talk
Subject: RE: Writing cfoutput to a text file

Yes but I need to dump the whole query formatted just how the sql query
formats it.

-----Original Message-----
From: Matt Robertson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 22, 2004 10:54 AM
To: CF-Talk
Subject: Re: Writing cfoutput to a text file

You can't 'dump' it, but you can output it.  Here's an example:

<cfquery
name="Maker"
datasource="test">
SELECT
myfile.FIELD1,
myfile.FIELD2
FROM myfile
WHERE
0=0
ORDER BY
myfile.FIELD1 ASC
</cfquery>
<cfloop query="Maker">
<cfset variables.DestFile="foo_" & Maker.FIELD1 & ".txt">
<cffile
action=""
output="#Maker.FIELD2#"
    file="c:\cfusionmx\wwwroot\bar\#variables.DestFile#">
</cfloop>

--
--Matt Robertson--
MSB Designs, Inc.
  _____
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to