As the title stated I wanted to import the content of .txt files to be displayed on cfm. I can import the text but problem is it is read as a full single line in the cfm. I need the paragraph formatting to be exactly as they were from the txt file. Can CF do this?
A text file will have LF or CRLF (chr(10) or chr(13)chr(10)) to mark a new line. In HTML you will need <br /> Easiest is to simply replace the chr(10) with <br>: <cfset myHTMLContent = Replace(txtFileContent,chr(10),'<br />', 'all'> You might wanna remove any CR with Replace(txtFileContent,chr(13),'', 'all'>, but it is normally not important. Reason why you replace the LF, chr(10) instead of the CR is simply because the LF is always there, the CR is not.