Hey list,
I'm trying to replace a double quote in a text field to a single quote. I've
tried using ReReplace, but it still crashes the Cold Fusion server.
What I've done is this:
cfoutput#REReplace(dills,,',ALL)#/cfoutput
See, users tend to like using double quotes in a text field which
Try:
cfoutput#REReplace('dills','',',ALL)#/cfoutput
Marius Milosav
ScorpioSoft Corp.
www.scorpiosoft.com
-Original Message-
From: Rick Sanders [mailto:[EMAIL PROTECTED]
Sent: November 1, 2007 8:47 AM
To: CF-Talk
Subject: Replacing Strings
Hey list,
I'm trying to replace a double
use single quotes in your replace function (and you don't need REReplace
just FYI).
REReplace('dills','',',ALL)
-Original Message-
From: Rick Sanders [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 01, 2007 7:47 AM
To: CF-Talk
Subject: Replacing Strings
Hey list,
I'm trying
ReReplace is for using a regular expression. Try Replace. You'll also
need to quadruple the double quotes, something like this should work:
#Replace(dills, , ', ALL)#
That is, the content of each expression is enclosed in double quotes
in this example. When the expression itself contains a
are you using cfqueryparam's on your query? It should escape them on its own I
would think.
~|
ColdFusion is delivering applications solutions at at top companies
around the world in government. Find out how and where now
replace('dills', '', ', all)
In other words, where you are explicitly writing double-quotes (like for
the find string) wrap in single quotes, and where you are explicitly
writing single quotes (like the replace string) wrap in double quotes.
--Ben Doom
Rick Sanders wrote:
Hey list,
:42 AM
To: CF-Talk
Subject: Re: Replacing Strings
are you using cfqueryparam's on your query? It should escape them on its own
I would think.
~|
ColdFusion is delivering applications solutions at at top companies
around
Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: November-01-07 10:46 AM
To: CF-Talk
Subject: RE: Replacing Strings
use single quotes in your replace function (and you don't need REReplace
just FYI).
REReplace('dills','',',ALL)
-Original Message-
From: Rick Sanders [mailto
-01-07 11:42 AM
To: CF-Talk
Subject: Re: Replacing Strings
are you using cfqueryparam's on your query? It should escape them on its own
I would think.
~|
Download the latest ColdFusion 8 utilities including Report
On Nov 1, 2007 7:44 AM, Rick Sanders [EMAIL PROTECTED] wrote:
Didn't think of that, but it's less code to do a replace than the
cfqueryparam.
the cfqueryparam buys you more.
and you should be using it anyway.
--
Charlie Griefer
...All the
: 919-799-9076
Canada: www.webenergy.ca
USA: www.webenergyusa.com
-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]
Sent: November-01-07 12:10 PM
To: CF-Talk
Subject: Re: Replacing Strings
Not to put too fine a point on it, but if this data is coming directly
from
!
Kind regards,
Rick Sanders
Canada: 902-401-7689
USA: 919-799-9076
Canada: www.webenergy.ca
USA: www.webenergyusa.com
-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: November-01-07 10:46 AM
To: CF-Talk
Subject: RE: Replacing Strings
use single
: Replacing Strings
Bigger rookie mistake is not using cfqueryparam.
Adam Haskell
http://cfrant.blogspot.com
On 11/1/07, Rick Sanders [EMAIL PROTECTED] wrote:
Hi Andy,
Thanks for your response. I can't believe I made the rookie mistake of not
using single quotes instead of double quotes
be...
not having to replace any kind of quotes. :-)
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Adam Haskell [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 01, 2007 11:28 AM
To: CF-Talk
Subject: Re: Replacing Strings
Bigger rookie
USA: www.webenergyusa.com
-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]
Sent: November-01-07 12:10 PM
To: CF-Talk
Subject: Re: Replacing Strings
Not to put too fine a point on it, but if this data is coming directly
from an end user, it would probably be in your
What database are you using? This sounds like something that would be best
handled at the database level, instead of running it through CF.
- Original Message -
From: Richard Crawford
Actually, my question about replacing special characters (thanks to all
who answered, by the way) was
Deanna Schneider wrote:
What database are you using? This sounds like something that would be best
handled at the database level, instead of running it through CF.
Deanna,
I'm using SQL Server 7.The problem is that the field with the
characters to be replaced is a TEXT field, and you can't
Don't know SQL Server. Sorry. But, as for your 500 error - make sure that
show friendly http errors is turned off in your IE preferences. Then, you
should at least see more info.
- Original Message -
From: Richard Crawford
Deanna Schneider wrote:
What database are you using? This
Deanna Schneider wrote:
Don't know SQL Server. Sorry. But, as for your 500 error - make sure that
show friendly http errors is turned off in your IE preferences. Then, you
should at least see more info.
That in itself isn't an issue (I don't use IE if I can possibly avoid
it).I had hoped
Actually, my question about replacing special characters (thanks to all
who answered, by the way) was part of a larger question.What I really
need to do is select all rows of one table, modify the value of one
field, and insert all of the rows, with that one modified field, into
another table.
(this tip may help you)
After struggling for a bit, found regular expressions could do what I wanted to do.
My problem:
Various files had varying strings in them, such as:
This file's name is:P1000104
This file's name is:P1000109
This file's name is:P1000167
etc.
I wanted to
21 matches
Mail list logo