Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Output to textfile

New Here ,
Apr 23, 2006 Apr 23, 2006
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.
TOPICS
Getting started
257
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 24, 2006 Apr 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2006 Apr 24, 2006
LATEST
typo: "#foo#"
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources