Another method that is useful occasionally is to use CF comments to
avoid the unwanted line breaks.

For example:
<cfsavecontent variable="dailyDif"><!---
---><cfoutput 
query="work4">1,22,"GJ","Locations","DailyReport","#Account#",#Total#
</cfoutput><!---
---></cfsavecontent>

Sometimes it is more readable than string concatenation.

Jon

On 3/1/06, Jamie Tieman <[EMAIL PROTECTED]> 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]


Reply via email to