Skip to main content
Participant
April 23, 2006
Question

Output to textfile

  • April 23, 2006
  • 2 replies
  • 268 views
Hey all,

I've got a setup on my website where a user uploads a text file, adds that information to a new table, does some manipulations and then send another text file back to the user.

This is my problem- it seems like it takes too long to write the text file and I get a 'Page cannot be displayed' error. Right now I just do a cffile to write the text file and go line by line appending it to the text file.

What I would like to do is try and append all the data from a table to an array and then do one output of the array to the textfile which would save me a lot of time for outputting.

Does anyone know how to put an array of information into a text file? I know how to get it to work with an excel file but I don't know how to add a line break between each record to the textfile.

Does anyone have any suggestions or perhaps another way of doing this?

I appreciate the help.
This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
April 24, 2006
typo: "#foo#"
April 24, 2006
Since you are writing to a file a "line at a time", you apparently have some delimiter that tells you where the line breaks are. You should be able to replace all occurrences of your line delimiter with a Chr(10), which is a new line character. Once this is done, you can append the entire variable to the file. See code below.