Page 1 of 1

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

Posted: Tue Jan 26, 2010 11:18 am
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?

Posted: Tue Jan 26, 2010 12:07 pm
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.