Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,844 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,650 people online right now. Registration is fast and FREE... Join Now!




Unwanted carriage return

 
Reply to this topicStart new topic

Unwanted carriage return, removing a carriage return from a CSV file

bruce779
9 Jul, 2008 - 05:02 AM
Post #1

New D.I.C Head
*

Joined: 29 May, 2007
Posts: 16



Thanked: 1 times
My Contributions
Hey.
I have output a CSV file using Coldfusion but the file has a blank line at he end.
I'm not including a carriage return and I can't find a way to stop it.
Anyone out there got an idea?
This is the code I'm using:
CODE

<cfset variables.out = "" />
<cfset variables.path = getDirectoryFromPath(getCurrentTemplatePath()) & 'Extracts\' />

<cfset CSVFileName="MyFife_#application.URLDecrypt(school)#_Myriad_#DateFormat(Now(),'ddmmyyyy')##LSTimeFormat(Now(),'HHMMSS')#.csv">
<cfset variables.path = variables.path & CSVFileName />

<cfset variables.out = variables.out & '"#myriadDetails[Count][1]#","#myriadDetails[Count][2]#","#myriadDetails[Count][3]#","#myriadDetails[Count][4]#","#myriadDetails[Count][5]#","#myriadDetails[Count][6]#","#myriadDetails[Count][7]#","#myriadDetails[Count][8]#","#myriadDetails[Count][9]#","#myriadDetails[Count][10]#","#myriadDetails[Count][11]#","#myriadDetails[Count][12]#"'>


Thanks for looking folks. smile.gif
User is offlineProfile CardPM
+Quote Post

bruce779
RE: Unwanted Carriage Return
9 Jul, 2008 - 05:44 AM
Post #2

New D.I.C Head
*

Joined: 29 May, 2007
Posts: 16



Thanked: 1 times
My Contributions
Fixed it.
The issue wasn't even with the code I posted tongue.gif

All I needed to do was add the attribute 'addnewline="false"' to
the <cffile>

The reason I missed this was I use the Fusebox framework and the colleague
I had been working alongside had put the <cffile> in the switch.cfm

Oh well, all's well that ends well.

Thanks for looking icon_up.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 05:48PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month