Category : Word Processors
Archive   : USEDI.ZIP
Filename : REFORMAT.INF

 
Output of file : REFORMAT.INF contained in archive : USEDI.ZIP


FILE: REFORMAT.INF - part of the U-SEDIT archive
January 13, 1990

REFORMATTING THE FILES IN THE U-SEDIT ARCHIVE FOR BETTER-
LOOKING OUTPUT ON A DOT-MATRIX PRINTER

The files have been formatted with no first-line indent and have
a rather narrow line width. The point was to provide you with an
excuse to run SED right after reading the documentation and see
how it works.

The following instruction will indent the left margin of a file
by five spaces - so that, when you print out the file, you'll
have a reasonable margin if you want to put the pages into a
three-ring binder. The files will then look much like this one.
The instruction is:

sed "s/^/ /" inputfile > outputfile

where "inputfile" is replaced by U-SED-IT.1, or whatever file
you want to process, and "outputfile" is replaced by the name
of a new file you want to write, with the indents added. DON'T
use the same name for the input file and the output file if you
give the command in this form!

You could, I suppose, over-write the original file (using the
commands shown in U-SED-IT.1) but don't take any chances for
starters.

Or you could do this:

sed "s/^/ /" inputfile > lpt1:

if your printer is up and running and you want to print a version
with indented lines immediately - look, Ma, no new file.

If you use Chris Dunford's CED command-line-editor program,
don't execute the command shown above until you've read about
CED in the file U-SED-IT.INF.

The quote marks in the command are *mandatory*. If you want
to indent the left margins more than four spaces, put as many
as you want on the "replace-with" side of the substitution
command.


HOW THE DOCUMENTATION FILES WERE REFORMATTED,
USING SED, FOR OUTPUT ON A LASER PRINTER

The text was all written as plain ASCII text on a DOS machine,




REFORMAT.INF - Part of U-SEDIT1.ZIP Page: 1



but the page layout work for the laser-printed copies was done
entirely on a Mac.

The original text files included simple formatting codes at the
beginning of certain lines - codes like:

.ex1 or .ex2 at the beginning of lines showing examples;

.sh at the beginning of sub-heading lines;

.note at the beginning of the first line of any paragraph
meant to set off certain text (as in: "NOTE: The copy of SED
included with this archive has NOT been designed to melt down
your computer if you don't register it" - and like that).

There were quite a few things which had to be done to the files
to make them usable by PageMaker on the Macintosh, but the lion's
share of the formatting was done with the following SED
instructions, placed into a script file (the comments within
square brackets do not, of course, appear in those positions
within the script files):

s/ \{2,\}$/ /g [Search for any line ending in two or more
spaces, and replace the spaces with one
space only]


s/^ \{1,\}$// [Search for any line consisting ONLY of
spaces, and delete the spaces]


s/^\.ex\([12]\) \{1,\}// [Search for any line
beginning with ".ex,"
followed immediately by either a numeral 1 or numeral 2, followed
by any number of spaces, and replace all that with " followed by whichever numeral was found, followed by ">". This
creates a PageMaker style-name tag (there were two different
"example" style tags).]

s/^\.sh \{1,\}// [Search for the beginning of any
line followed by ".sh" followed by
any number of spaces, and replace all of that with the style tag
"".]

s/^\.note \{1,\}// [Search for any line beginning
".note" followed by any number of
spaces, and replace all that with the style tag "".]

/^/ [EXCEPT for lines beginning with a
"<" character, put the style tag
"" at the beginning of EVERY line in the file]



REFORMAT.INF - Part of U-SEDIT1.ZIP Page: 2



[naturally, this puts "" onto blank lines, too. So:]

s/^$// [Find any blank line which begins with " text>" and IMMEDIATELY ends - and remove the
text on the line.]

s///g [Search for the CTRL U character - used by my text
editor to create italics - and replace it with a
CTRL D character (later used by PageMaker to create italics when
importing the text).]

s/ - / -- /g [Find any occurrence of "space hyphen space"
and change it to "space hyphen hyphen space."
PageMaker interprets that as an EM (long) dash.]


s/\.\.\./. . ./g [Search for three dots ... like that ... and
put 'em into typographically correct form: . . .]


Of course, the "" tag ended up at the beginning of
*every* line that wasn't blank or that didn't already begin with
a "<" character - a thorny little problem at first, but one that
turned out to be moderately easy to solve with SED. See the file
SFILES-B.1 for information on how to use SED to find a line
*beginning* with a certain string, followed by a line beginning
with the identical character string, and remove the string on the
second line - leaving it intact on the first.

When that formatting was done the files were reformatted again
to put them in a form useful for uploading to bulletin boards.
Here again I used SED (along with CHG.EXE) to do the work, though
the commands were much simpler: remove all ".note" tags; change
any ".ex" or ".sh" tag to an indent of eight spaces; replace all
of the CTRL U characters with an asterisk; and just for the hell
of it, add a CTRL Z to the very end of the file.

The formatting was all done via batch file, with search/replace
instructions in addition to those shown above carried out via the
CHG.EXE program. The typical time on a slow-ish hard disk to
reformat the U-SED-IT.1 file was about 60 seconds. On a RAM disk
it took about half that time.

Enjoy.

Mike Arst
January 13, 1990

(E N D)




REFORMAT.INF - Part of U-SEDIT1.ZIP Page: 3






  3 Responses to “Category : Word Processors
Archive   : USEDI.ZIP
Filename : REFORMAT.INF

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/