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

Import .txt file content into cfm page

Explorer ,
Jul 30, 2006 Jul 30, 2006

Copy link to clipboard

Copied

I'm using cfftp to download .txt files from a third-party content provider into a local folder. I need to display the text within the txt file in a cfm page.

Anybody have any good tips for importing or converting the contents of a .txt file so it will display within a cfm template?

Thank you.

Scott
TOPICS
Advanced techniques

Views

413

Translate

Translate

Report

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
Contributor ,
Jul 30, 2006 Jul 30, 2006

Copy link to clipboard

Copied

Scott-
You haven't explained what the format of the text file is and how you want to display it. You can get the contents of a file with CFHTTP (if it's in a web-readable directory) and treat it as a query if it is in a delimited data format. Then you can use CFOUTPUT as you would with any other query.

You can also use CFFILE to read the contents of a text file and display it in your page. You can use HTML PRE tags or you can replace the CR/LF with a BR tag to force a line break.. Lots of options, depending on your particular situation.

Votes

Translate

Translate

Report

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
Explorer ,
Aug 08, 2006 Aug 08, 2006

Copy link to clipboard

Copied

LATEST
Thanks Dempster.

Yes, I just read the .txt file using cffile and assigned it to a variable then displayed it.

Worked great.

Votes

Translate

Translate

Report

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
Documentation