TXT2HTML: Create HTML from TEXT

Macro name. TXT2HTML Edit macro TXT2HTML
users. HTML authors Author: David McRitchie
type. Edit Macro resides in d:\spfmacro  for use with SPF/PC
TXT2HTML Create an HTML version of a TEXT file or convert a CC-range text portion to HTML.
Related HTMLSYN use is recommended after using TXT2HTML.

TXT2HTML create an HTML version of a TEXT file or converts a CC-range text portion to HTML.

This macro allows one to convert an entire file in edit to an HTML version.  It also allows you to convert individual or a group of lines to HTML from text.


ISREDIT  TXT2HTML  [TT] | [EX]

CC-range A process range between CC line commands is an acceptable line-range for this macro.  The default is to process all lines.
TT Group of lines surrounded by <tt> ... </tt>, and individual lines prefixed by <br>
EX Group of lines surrounded by <tt> ... </tt>, and individual lines prefixed by "<br>&nbsp. ", particularly for single line examples.

Example:  convert range of lines in edit to HTML, no options used

=NOTE= ==================== ORIGINAL LINES OF TEXT ============================
This is an example of a text within a file containing such
items as <TT> &   <html> ... </html>
it will be converted as follows:
=NOTE= ==================== ORIGINAL LINES OF TEXT ============================

=NOTE= ======================= TXT2HTML 08:52:08 ==============================
<PRE>
This is an example of a text within a file containing such
items as &lt;TT&gt; &amp;   &lt;html&gt; ... &lt;/html&gt;
it will be converted as follows:
</PRE>
=NOTE= ======================= TXT2HTML 08:52:08 ==============================
The following shows what converted text would look like in the edit panel.

Had the no CC-range been used and the original lines above been the complete text the conversion in the EDIT panel would have looked something like the following:

SPF/PC(1) EDIT x:\xxxxxx\xxxxxx\xxx\xxxxx.HTM --------- COLUMNS 001 072
COMMAND ===>
=NOTE= ========================== TXT2HTML 08:57:50 ===================
000001 <html>
000002 <head>
000003 <title>X:\XXXXXXX\XXXXXX\XXX\xxxxx.HTM</title>
000004 </head>
000005 <body>
000006 <h1>X:\xxxxxxx\xxxxxx\xxx\xxxxx.HTM</h1>
000007 <PRE>
000008 This is an example of a text within a file containing such
=NOTE= items as <TT> &   <html> ... </html>
000009 items as &lt;TT&gt; &amp;   &lt;html&gt; ... &lt;/html&gt;
000010 it will be converted as follows:
000011 </PRE>
000012 </body>
000013 </html>
=NOTE= ========================== TXT2HTML 08:57:50 ==================


Taking the above adding <p> after line 10 and then copying lines
8-9 after the <p> on line 11.  With CC-range on lines 13 .. 14 and
invoking TXTHTML TT     the results would appear as follows:

SPF/PC(1) EDIT x:\xxxxxx\xxxxxx\xxx\xxxxx.HTM --------- COLUMNS 001 072
COMMAND ===>
000001 <html>
000002 <head>
000003 <title>X:\XXXXXXX\XXXXXX\XXX\xxxxx.HTM</title>
000004 </head>
000005 <body>
000006 <h1>X:\xxxxxxx\xxxxxx\xxx\xxxxx.HTM</h1>
000007 <PRE>
000008 This is an example of a text within a file containing such
000009 items as &lt;TT&gt; &amp;   &lt;html&gt; ... &lt;/html&gt;
000010 it will be converted as follows:
000011 <p>
000012 <TT>
000013 <BR>&nbsp; items as &amp;lt;TT&amp;gt; &amp;amp;   &amp;lt;html&a... &amp;lt;/html&amp;gt;
000014 </TT>
000015 </PRE>
000016 </body>
000017 </html>

The Final result would appear in a document at follows:

X:\xxxxxxx\xxxxxx\xxx\xxxxx.HTM

This is an example of a text within a file containing such
items as <TT> &   <html> ... </html>
it will be converted as follows:



items as &lt;TT&gt; &amp; &lt;html&gt; ... &lt;/html&gt;

TXT2HTML code which runs on SPF/PC should also work on TSO.  A complete list of macros available at my site can be found at http://www.geocities.com/davemcritchie/nclist.htm.

Comments and Related Information

You are visitor  ctr since count started May 29, 1997.

Please send your comments concerning my pages or materials to:  David using send email comments

Disclaimer and site usage:  Material at The REXX Macros Toolbox is available without warranty of any kind.  Redistribution of source, coding and documentation other than from this site is prohibited.

Copyright © 1995 - 2006, F. David McRitchie, All Rights Reserved