Is it possible to convert br&gt - &lt - &#39

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
steve1040
Posts: 39
Joined: Fri Oct 13, 2006 2:19 am

Is it possible to convert br&gt - &lt - &#39

Post by steve1040 »

I have a large data file that I'm trying to cleanup in Textpad before importing into a new database.

In scanning the records I see characters like
br&gt - &lt - &#39
Are these character codes that got picked up in error?

How can I remove or convert this to the correct character?
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

These look like the result of a bad conversion from HTML (or similar) to plain text.

br is perhaps from <br> or <br/> , which represents a newline.
&gt is perhaps from &gt; , which represents > (greater than).
&lt is perhaps from &lt; , which represents < (less than).
&#39 is perhaps from &#39 ; (without the space in it, which I had to insert to stop it being interpreted here), which represents the character with ASCII value 39, that is, ' (apostrophe).

All the replacements below require
[X] Regular expression
To replace the occurrences of br :
Find what: \<br\>
Replace with: \n
To replace the occurrences of &gt :
Find what: &gt\>
Replace with: >
To replace the occurrences of &lt :
Find what: &lt\>
Replace with: <
To replace the occurrences of &#39 :
Find what: &#39\>
Replace with: '
The regex symbols \< and \> anchor their positions in the match to the beginning or end, respectively, of a word.
Post Reply