Page 1 of 1

Conversion from HTML to txt?

Posted: Sat Oct 11, 2003 2:36 pm
by insitus
I am wondering whether Textpad allows to convert html files into simple txt files. If so, how? Satoshi

Posted: Sat Oct 11, 2003 3:18 pm
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...

Posted: Sat Oct 11, 2003 4:07 pm
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.

Posted: Sat Oct 11, 2003 4:12 pm
by insitus
Yes. I meant visible text.
I did not realize that your tip was too simple.
It worked nicely.
Satoshi

Posted: Sat Oct 11, 2003 9:49 pm
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

Posted: Sat Oct 11, 2003 11:19 pm
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)

Posted: Sun Oct 12, 2003 2:13 am
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. ;)

Posted: Sun Oct 12, 2003 3:49 am
by Bob Hansen
Thanks talleyrand, I modified the original......... :oops:

This is the place to be pedantic. :D