Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-10-02
5
Medium Priority
?
686 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 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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

885 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