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

Join 117,577 Programmers for FREE! Ask your question and get quick answers from experts. There are 2,185 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! 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
post 9 Jul, 2008 - 06:02 AM
Post #1


New D.I.C Head

*
Joined: 29 May, 2007
Posts: 15



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

Go to the top of the page


bruce779
post 9 Jul, 2008 - 06:44 AM
Post #2


New D.I.C Head

*
Joined: 29 May, 2007
Posts: 15



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

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 08:59PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month