What would you recommend for Plain-Text Conversion Utilities

General questions about using TextPad

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

Post Reply
User avatar
no.cache
Posts: 165
Joined: Thu May 15, 2003 2:52 pm

What would you recommend for Plain-Text Conversion Utilities

Post by no.cache »

I'm interested in either a Textpad (macro, whatever) -or- if you have a standalone freeware/opensource widget that you use. There's a profusion of browser addons/apps that convert html files into plain text (well duh, it's called "Save As" lol) but it's much more difficult to take plain text and convert it into an HTML table, or a list of URL addresses in a ~.txt file to HTML hyperlinks. Thanks guys.

sm
Trump.
Jesus wept.
User avatar
Drxenos
Posts: 210
Joined: Mon Jul 07, 2003 8:38 pm

Post by Drxenos »

I don't understand the distinction you are trying to make. HTML is plain text. Do you mean the resultant text displayed by the browser from HTML?
User avatar
no.cache
Posts: 165
Joined: Thu May 15, 2003 2:52 pm

Post by no.cache »

LEGEND
@ = TAB
% = CARRIER RETURN (\n in Textpad)

EXAMPLE
ROW 1 = 1 column
ROW 2 = 3 columns
ROW 3 = 6 columns
................................................................................
Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam. %
@ ALIQUAM PHARETRA @ ETIAM AUGUE %
@ PEDE, MOLESTIE EGET @ CONVALLIS UT, EROS @ NULLA IN TELLUS EGET @ ODIO SAGITTIS BLANDIT @ MAECENAS AT NISL %
................................................................................

What I'm asking is if there is some kind of program/widget/macro that can read the TABS on those three lines, convert them into COLUMNS, and render the whole thing as an HTML TABLE. Thanks!
Trump.
Jesus wept.
User avatar
AmigoJack
Posts: 490
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

Search and replace that with regular expressions.

Find what: \t
Replace with: </td><td>

Find what: ^(.+)\n
Replace with: <tr><td>\1</td></tr>

Now you just need some definition on where the table starts (suggestion: empty line) and where it ends (last line shouldn't have a carriage return).
User avatar
no.cache
Posts: 165
Joined: Thu May 15, 2003 2:52 pm

Post by no.cache »

Thanks AmigoJack!
Trump.
Jesus wept.
Post Reply