Hi,
I'm converting a whole bunch of Thunderbird emails into eml files, then into .csv, then into Excel, the into DBf format.
I've done all this so far, but of course the body of the email is littered with html codes.
How can I strip all the html out, and leave only text? I can probably replace <br> with character returns and line feeds, but I'd like to strip out all of the html in each body memo field into text.
How to convert html from emails into text?
Moderator: Rathinagiri
-
- Posts: 197
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: How to convert html from emails into text?
It is quite simple:
Code: Select all
Function HTMLToPlainText ( cHTML )
Local oHTMLDoc := CreateObject( "HTMLFile" )
Local cPlainText
oHTMLDoc:Write ( cHTML )
cPlainText := oHTMLDoc:body:innerText
oHTMLDoc := Nil
RETURN cPlainText
-
- Posts: 197
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: How to convert html from emails into text?
I'll give it a try, thanks edk.
- serge_girard
- Posts: 3309
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: How to convert html from emails into text?
Thanks Edward, this is what I also needed !
Serge
Serge
There's nothing you can do that can't be done...