Solved

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

Posted on 2008-10-02
5
678 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
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 gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
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…

786 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