Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2008-10-02
Medium Priority
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">            

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?
Question by:paddycobbett
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 39

Accepted Solution

gdemaria earned 2000 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

Author Comment

ID: 22634738
that did it thanks!

Expert Comment

ID: 22635141
LVL 39

Expert Comment

ID: 22635270
<br> is HTML, not for an  ascii file

Author Closing Comment

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

Featured Post

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

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

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

705 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