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

Removing Carriage Returns

Explorer ,
Jun 22, 2006 Jun 22, 2006
I have a table with a field that contains data such as this, and I want to remove all of the carriage returns but I am having difficultiy. I have tried replacing the chr(13) and the chr(10) but no such luck. Can anyone help? Thanks!

==== start of code block ====

Part Number: 1307 G9<BR>



Finish Family:






CHROMES<BR>




Finish/Color:






STERLING NICKEL<BR>




Dimensions:






1 1/4 INCH DIAMETER<BR>




Collection:






BRASS & STERLING TRADITIONS<BR>

==== end of code block====
2.8K
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
Mentor ,
Jun 22, 2006 Jun 22, 2006
Have you tried using cfprocessingdirective?

Specifies whether to remove excess whitespace character from ColdFusion generated content in the tag body.
Identifies the character encoding (character set) of the page contents.

<cfprocessingdirective
suppressWhiteSpace = "yes" or "no"
pageEncoding = "page-encoding literal string">
CFML tags
</cfprocessingdirective>


Phil
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
Contributor ,
Jun 22, 2006 Jun 22, 2006
Try these two:
ParagraphFormat(your_var)
StripCR(your_var)
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
Explorer ,
Jun 24, 2006 Jun 24, 2006
LATEST
Hi,

For me both database as well as coldfusion worked fine. You may also please try with small example.

Method 1:
***********
At database side
select
replace(columnname,chr(13)||chr(10),' ') as columnname
from <tablename>

Method 2: Coldfusion
***********************
<cfset pageContent = reReplace(pageContent, chr(10)&chr(13),"", "all" )>

I noticed that the regular expression functions in CF support the newline character \n Chr(10), carriage return \r Chr(13), and tab \t Chr(9).

<cfsavecontent variable="data">
here is my
break
</cfsavecontent>

<cfoutput>#ReReplace(data, "\n", "<br />", "ALL")#</cfoutput>

Method 3: Coldfusion.
*************************
Please go through the below article. Example is mentioned
http://livedocs.macromedia.com/coldfusion/6/CFML_Reference/functions-pt248.htm

Hope this helps. Please try it out.

Satheesh.
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