Maybe try a <cfcontent reset="true"> right before your <cfsavecontent>.
Maybe for some reason the output buffering is messing it up.

/cody 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of [EMAIL PROTECTED]
Sent: Wednesday, March 01, 2006 1:49 PM
To: [email protected]
Subject: Re: [CFCDev] CSV and blank lines

You could try
<cfloop query="work4">
<cfset dailyDIF = dailyDif & '1,22,"GJ","Locations","Daily
Report","#Account#",#Total##chr(13)#'>
</cfloop>

depending on your csv's consumer you may need chr(10) in addition to or
instead of chr(13) as the line feed.

Jason Cronk
Verizon






 

                      "Jamie Tieman"

                      <[EMAIL PROTECTED]        To:       "Cfcdev"
<[email protected]>                                                 
                      t.net>                   cc:

                      Sent by:                 Subject:  [CFCDev] CSV and
blank lines                                                  
                      [EMAIL PROTECTED]

                      one.org

 

 

                      03/01/2006 04:24

                      PM

                      Please respond to

                      CFCDev

 

 





I have a CFC that is trying to create a CSV file, save it to the server, and
then have an FTP program download it.
Problem is, I end up with blank lines at the end of my file.  If I put the
[cfoutput query="work4"] on a separate line, I get a blank line first, data,
and then the 3 blank lines, this way I only get the blank lines at the end.

Here's the code:

<cfsavecontent variable="dailyDif">
<cfoutput query="work4">1,22,"GJ","Locations","Daily
Report","#Account#",#Total#
</cfoutput>
</cfsavecontent>
<cfset fileDir = "[server directory
string]#Args.inCompanyNo#\#Args.inYear#\#Left(MonthAsString(Args.inMonth),3)

#\" />
<cfset filename =
"#fileDir##arguments.Args.inCompanyNo#_DailyDif_#Left(MonthAsString(Args.inM

onth),3)#.csv"/>
<cffile action="write" file="#filename#" output="#dailyDif#">

And this is what I end up with.

1,22,"GJ","Locations","Daily Report","036000",-23429.67
1,22,"GJ","Locations","Daily Report","050500",-148080.60


And that looks great, BUT it has 3 blank lines at the end even if I do a
cfloop for one record.

Any help would be greatly appreciated,
Jamie



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]









----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]






----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to