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

You don't need the cfsavecontent tag

Jason Cronk




                                                                                
                                                       
                      "Jamie Tieman"                                            
                                                       
                      <[EMAIL PROTECTED]        To:       [email protected]    
                                                        
                      t.net>                   cc:                              
                                                       
                      Sent by:                 Subject:  RE: [CFCDev] CSV and 
blank lines                                              
                      [EMAIL PROTECTED]                                         
                                                       
                      one.org                                                   
                                                       
                                                                                
                                                       
                                                                                
                                                       
                      03/02/2006 11:10                                          
                                                       
                      AM                                                        
                                                       
                      Please respond to                                         
                                                       
                      CFCDev                                                    
                                                       
                                                                                
                                                       
                                                                                
                                                       




I'm sorry, that went right over my head.  The file is only 10-20 lines.  Is
this what your saying?

<cfset var lineData = "" >
<cfsavecontent variable="dailyDif">
<cfoutput query="work4">
<cfset lineData = lineData 1,22,"GJ","Locations","Daily
Report","#Account#",#Total#/n >
</cfoutput>
</cfsavecontent>

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
Of
Daniel Roberts
Sent: Thursday, March 02, 2006 8:08 AM
To: [email protected]
Subject: Re: [CFCDev] CSV and blank lines


The problem is that you are including line breaks within the savecontent
tag
as part of a loop. Concatenating a string in a loop would probably be the
cleanest solution. If you are building large files with thousands of
records
you'll want to check out java string concatenation. Otherwise you can try
just putting multiple tags on the same line to eliminate breaks, or span
comments between tags to comment out the unwanted newline characters.



On 3/1/06, Kenton Gray <[EMAIL PROTECTED]> wrote:
I would try doing a cfloop and do a cfoutput inside that. I've had
similar problems and that seems to always be the easiest way, or as
mentioned you may have to do a cfset and just append it to a variable
with a new line character for each row.

Good luck!

Kenton



On Mar 1, 2006, at 3:24 PM, Jamie Tieman wrote:

> 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]



----------------------------------------------------------
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