Find and Replace hidden characters

  • Thread starter Thread starter Lars Forslin
  • Start date Start date
L

Lars Forslin

I want to replace carriage returns with <p> for a database-driven website.
However, I have no luck using either pilcrow sign (¶) or ^p, which is the
special sign for carriage returns in Word. Is there a way?

Regards,

--
Lars Forslin

http://www.connect.to/forslin

"Doing time on earth"

**************************
 
I want to replace carriage returns with <p> for a database-driven website.
However, I have no luck using either pilcrow sign (¶) or ^p, which is the
special sign for carriage returns in Word. Is there a way?

Regards,

An Access new-line is actually two characters: a carriage return,
ASCII code 13, followed by a linefeed, ASCII code 10.

Try

Replace([fieldname], Chr(13) & Chr(10), "<P>")
 
Thanks, that is probably very useful information, but where do I use it?
Sorry, but I am quite a novice. Could you give me a hint?
Regards,
Lars Forslin

John Vinson said:
I want to replace carriage returns with <p> for a database-driven website.
However, I have no luck using either pilcrow sign (¶) or ^p, which is the
special sign for carriage returns in Word. Is there a way?

Regards,

An Access new-line is actually two characters: a carriage return,
ASCII code 13, followed by a linefeed, ASCII code 10.

Try

Replace([fieldname], Chr(13) & Chr(10), "<P>")
 
Thanks, that is probably very useful information, but where do I use it?
Sorry, but I am quite a novice. Could you give me a hint?
Regards,
Lars Forslin

Sorry!

Create a Query based on the table that you want to update. Change it
to an Update query (using the query type icon). If the field is named
MyField, type on the Update To line:

Replace([MyField], Chr(13) & Chr(10), "<p>")

Run the Query.

This will work if you have Access2002 or later, it may not in 2000; if
it doesn't, create a new Module named Utilities, and edit or copy into
it:

Public Function QReplace(sIn As String, sOld As String, _
sNew As String) As String
QReplace = Replace(sIn, sOld, sNew)
End Function

and use QReplace instead of Replace in the update query.
 
Thanks a lot for that info. I'll try that one.
/Lars
John Vinson said:
Thanks, that is probably very useful information, but where do I use it?
Sorry, but I am quite a novice. Could you give me a hint?
Regards,
Lars Forslin

Sorry!

Create a Query based on the table that you want to update. Change it
to an Update query (using the query type icon). If the field is named
MyField, type on the Update To line:

Replace([MyField], Chr(13) & Chr(10), "<p>")

Run the Query.

This will work if you have Access2002 or later, it may not in 2000; if
it doesn't, create a new Module named Utilities, and edit or copy into
it:

Public Function QReplace(sIn As String, sOld As String, _
sNew As String) As String
QReplace = Replace(sIn, sOld, sNew)
End Function

and use QReplace instead of Replace in the update query.
 
Back
Top