Solved

How do i write an end of line character in coldfusion?

Posted on 2008-10-02
5
679 Views
Last Modified: 2010-04-21
I am writing to a file, whereby each string entry in the file is delimeted by the end of the line. However i can't find the end of line character. Right now i'm doing this:

<CFLOOP ... for each string>
   <CFFILE action="append" file="outFile" output="string" addNewLine="yes">            
</CFLOOP>

i.e. writing out each line at a time to make use of the "addNewLine" feature! Clearly not the best way..

.. and so ideally for performance i'd like to concatenate the string and write it out like in one go like this:

<CFFILE action="write" file="outFile" output="entire string">      

How do i insert an end of line char in a coldfusion string?
0
Comment
Question by:paddycobbett
  • 2
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 22628931
If using windows its #chr(13)##chr(10)#    (carriage return, line feed)

If that doesn't work, reverse the 10 and 13
0
 
LVL 1

Author Comment

by:paddycobbett
ID: 22634738
that did it thanks!
0
 
LVL 2

Expert Comment

by:storeytime
ID: 22635141
<br>
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 22635270
<br> is HTML, not for an  ascii file
0
 
LVL 1

Author Closing Comment

by:paddycobbett
ID: 31502547
Sorry, i thought i'd already awarded. Thanks again!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question