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

Cffile - reading text file and keeping line breaks

Participant ,
Jun 11, 2009 Jun 11, 2009

I'm trying to use cffile to read a text document and then add then display the text document contents in a .xml file for an atom feed. Everything is working correctly except it appears that cffile is stripping out the line breaks in the original file so that the contents of the variable that is save no longer has any line breaks. Is there an attribute that I'm missing that will control this behavior or do I need to go about this a different way. Thanks in advance for any insight on this issue.

2.3K
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

correct answers 1 Correct answer

Valorous Hero , Jun 11, 2009 Jun 11, 2009

Why do you say the line breaks are stripped out?

If you are just saying this because when you look at the results in your browser.  Recall that the HTML standard ignores all line breaks and most other white space.  A quick view of the source will tell you if the line breaks are there or not.  Using the HTML <pre>...</pre> tags is the proper method for telling a browser not to ignore the whitespace in the source.

But it is possible that somewhere along the conversion process from text file to XML d

...
Translate
Valorous Hero ,
Jun 11, 2009 Jun 11, 2009

Why do you say the line breaks are stripped out?

If you are just saying this because when you look at the results in your browser.  Recall that the HTML standard ignores all line breaks and most other white space.  A quick view of the source will tell you if the line breaks are there or not.  Using the HTML <pre>...</pre> tags is the proper method for telling a browser not to ignore the whitespace in the source.

But it is possible that somewhere along the conversion process from text file to XML data line breaks are being stripped.  But then we would need to see important peices of your process to have a chance of helping you.

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
Participant ,
Jun 11, 2009 Jun 11, 2009
LATEST

Thanks Ian, using the htmlcodeformat function on my variable created by cffile before using the xmlformat function when creating the xml did the trick. Thanks for the quick response.

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