Solved

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

Posted on 2008-10-02
5
675 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
Comment Utility
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
Comment Utility
that did it thanks!
0
 
LVL 2

Expert Comment

by:storeytime
Comment Utility
<br>
0
 
LVL 39

Expert Comment

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

Author Closing Comment

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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now