Conversion from HTML to txt?

General questions about using TextPad

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

Post Reply
insitus
Posts: 63
Joined: Sat Sep 13, 2003 10:47 pm

Conversion from HTML to txt?

Post by insitus »

I am wondering whether Textpad allows to convert html files into simple txt files. If so, how? Satoshi
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Which conversion would you want?

Just the visible text?

Open the file in your web browser. Select all the text and copy it...
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

After viewing in Text per MudGuard, you can also run the provided macro named Strip Tags (file named HELIOS09.TPM in ...\TextPad 4\Samples\ folder.

This does a great job of removing all tags, reducing the HTML even mor to a "text" file.

If the macro is not listed from the Main Menu, Close all files, Add the macro by going to Configure, Preferences. Click on Macros. Highlight Strip Tags and add to the column on the right. Click Apply, and OK out. restart TextPad.

Note: It may not always be necessary, but I have made a habit of doing all Configure changes when all documents are closed, modifying configurations as necessary, closing and reopening TextPad. TestPad guidelines may not require this every time, but it is easier to do it that way, than to guess when I have to do like that.
Hope this was helpful.............good luck,
Bob
insitus
Posts: 63
Joined: Sat Sep 13, 2003 10:47 pm

Post by insitus »

Yes. I meant visible text.
I did not realize that your tip was too simple.
It worked nicely.
Satoshi
insitus
Posts: 63
Joined: Sat Sep 13, 2003 10:47 pm

Post by insitus »

Thanks Bob Hansen.

As you suggested, I tried StripTag macro. When I test ran, I found that all tags were removed except " " tage. But it was great!!! StripTag seems to be immunized against " . Satoshi
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Hello insitus.

Actually   is not a tag, macro is working correctly.

:idea: You could make your own macro to

1. Go to beginning of document,
2. Call the StripTags macro,
3. Return to beginning of document,
4. Do an additional Search/Replace for the "non-tag"   strings.

=============================================
Edited:(added ";" as caught per talleyrand on subsequent post)
Last edited by Bob Hansen on Sun Oct 12, 2003 3:48 am, edited 2 times in total.
Hope this was helpful.............good luck,
Bob
User avatar
talleyrand
Posts: 625
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

Not to be pedantic, but the character reference is   Just added that in case someone glances through the solution a few weeks from now to prevent follow up posts whining about a semicolon appearing in their document. ;)
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Thanks talleyrand, I modified the original......... :oops:

This is the place to be pedantic. :D
Post Reply