Dec 062017
 
GTU (GMUtant Text Utilities) offers 20 different filter operations for ASCII files. Sort lines, add soundex codes, trim margins (with word wrap), count words, character frequency, reverse order of lines, and more.
File GTU15.ZIP from The Programmer’s Corner in
Category Word Processors
GTU (GMUtant Text Utilities) offers 20 different filter operations for ASCII files. Sort lines, add soundex codes, trim margins (with word wrap), count words, character frequency, reverse order of lines, and more.
File Name File Size Zip Size Zip Type
GTU.DOC 17648 5707 deflated
GTU.EXE 20956 20326 deflated

Download File GTU15.ZIP Here

Contents of the GTU.DOC file


GTU - The GMUtant Text Utilities Version 1.4
(c) 1991 GMUtant Software

GMUtant OnLine BBS: (703) 993-2219 1200/2400/9600 v.32

GTU is a collection of string processing utilities--gathered together in
a semi-convenient package. Most are simple routines which you may well have
already in single-application form. The value of GTU (if indeed it has one),
is that the routines are collected and run under a common syntax.

QUICKSTART: Enter GTU at the DOS prompt. The opening screen shows the sorts
of things GTU can do for you. Enter an input file to process, an output file
to hold the results of the processing, then select the desired option.

I. INTERACTIVE MODE.

If you enter GTU at the DOS prompt, you receive something like the
following screen:

-------------------------------------------------------------------------------
GTU - GMUtant Text Utilities Version # (c) 19xx, GMUtant Software
-------------------------------------------------------------------------------
GTU filters files, creating an output file with the result of its work.
As the prompts appear below, enter the name of your input and output files,
Then choose a processing option enter its letter code (LUFRAPCNBSTW or Q).
-------------------------------------------------------------------------------
L -> Convert text in f1 to LOWER case.
U -> Convert text in f1 to UPPER case.
F -> Capitalize FIRST Letter Of Every Word In File.
R -> REVERSE text in file (e.g., Hello world! -> !dlrow olleH)
A -> ADD a 5 character left margin to your output file.
P -> PULL left margin of text flush (zap leading spaces).
C -> CENTER text in file on 80 character line.
N -> Add line NUMBERS to file.
B -> Strip Hi-bits from file (WordStar -> ASCII).
S -> Add SOUNDEX code at start of each line.
I -> Invert lines in f1.
T -> TOTAL number of lines and words in f1. Output file optional.
W -> Extract unique WORDS in file. Produced sorted list.
Q -> QUICKsort lines in file (625 lines maximum file size).
G -> GO from ASCII to WordStar.
Z -> ZAP multiple blank lines from input file.
-------------------------------------------------------------------------------
Name of Input File: Name of Output File:
Processing Option [LUFRAPCNSTW or Q]:


II. COMMAND LINE ARGUMENTS.

Should you desire, GTU has been designed to accept command line
arguments. Enter GTU /h at the DOS prompt for a help message
Essentially, the form of your command is:

GTU x INPUTFILE OUTPUTFILE where x is the processing
option desired.

For example, GTU X INPUT.FIL OUTPUT.FIL would extract unique
words in INPUT.FIL, sort them, then write them to OUTPUT.FIL


III. PROCESSING OPTIONS

The options described below all use the QUICKSTART paragraph from the
beginning of this documentation for sample output.

-----------------------------------------------------------------------
L - converts a file to all upper case. Here's the 'quickstart' paragraph
seen earlier after 'L' processing:

quickstart: enter gtu at the dos prompt. the opening screen shows the
sorts of things gtu can do for you. enter an input file to process, an
output file to hold the results of the processing, then select the desired
processing option.
---------------------------------------------------------------------------
U - converts file to all upper case.

QUICKSTART: ENTER GTU AT THE DOS PROMPT. THE OPENING SCREEN SHOWS THE
SORTS OF THINGS GTU CAN DO FOR YOU. ENTER AN INPUT FILE TO PROCESS, AN
OUTPUT FILE TO HOLD THE RESULTS OF THE PROCESSING, THEN SELECT THE DESIRED
PROCESSING OPTION.

---------------------------------------------------------------------------
F - capitalizes the first letter of each word.

Quickstart: Enter Gtu At The Dos Prompt. The Opening Screen Shows The
Sorts Of Things Gtu Can Do For You. Enter An Input File To Process, An
Output File To Hold The Results Of The Processing, Then Select The Desired
Processing Option.

---------------------------------------------------------------------------
R - reverses strings in the file (why would you want to do this? We
included it just because it's kinda neat). Might help you identify
undiscovered palindromes in your writing style...

eht swohs neercs gninepo ehT .tpmorp SOD eht ta UTG retnE :TRATSKCIUQ
na ,ssecorp ot elif tupni na retnE .uoy rof od nac UTG sgniht fo stros
derised eht tceles neht ,gnissecorp eht fo stluser eht dloh ot elif tuptuo
.noitpo gnissecorp

---------------------------------------------------------------------------
A - adds a 5 character left margin.

User enters a number for the right margin position. Any line with a length
less than this number will be padded on the left with spaces, yielding a
flush right margin. Lines longer than the number entered are not changed.

QUICKSTART Enter GTU at the DOS prompt. The opening screen shows the
sorts of things GTU can do for you. Enter an input file to process, an
output file to hold the results of the processing, then select the desired
processing option.

---------------------------------------------------------------------------
P - pulls text flush with 0 position in file.

QUICKSTART: Enter GTU at the DOS prompt. The opening screen shows the
sorts of things GTU can do for you. Enter an input file to process, an
output file to hold the results of the processing, then select the desired
processing option.

---------------------------------------------------------------------------
C - centers strings in file on an 80 character line.

QUICKSTART: Enter GTU at the DOS prompt. The opening screen shows the
sorts of things GTU can do for you. Enter an input file to process, an
output file to hold the results of the processing, then select the desired
processing option.


Note: If GTU encounters a line longer than 80 characters, processing of option
C is aborted.

---------------------------------------------------------------------------
S - soundex Adds a 4 character SOUNDEX code before each line. The first
word of the line is extracted and assigned a soundex code.

Q363 QUICKSTART Enter GTU at the DOS prompt. The opening screen shows the
S632 sorts of things GTU can do for you. Enter an input file to process, an
O313 output file to hold the results of the processing, then select the desired
P625 processing option.

This option is useful if you use soundex filing in your paper files and want
to create indexes of topics. For example, enter a list of names, then
run through GTU with the 'S' option. Use the output file listing as your
filing guide (after sorting via the Q option).

Soundex code generated: First letter of word plus 3 digits (e.g. A234).

---------------------------------------------------------------------------
N - add NUMBERS to lines.

1 QUICKSTART Enter GTU at the DOS prompt. The opening screen shows the
2 sorts of things GTU can do for you. Enter an input file to process, an
3 output file to hold the results of the processing, then select the desired
4 processing option.

Blank lines are skipped and not assigned numbers.

-------------------------------------------------------------------------
B - Strip Hi Bits.
This option will Un-Wordstar a file; that is, reset the 8th bit in
an ASCII file so that it displays correctly. If you look at a
WordStar file under DOS (e.g., type xxxx.doc ), you'll see
lot's of funny looking characters--the extended ASCII character
set. This option will reset those bytes to 7 bit characters.
Here's a sample of the process:

Before (a wordstar file):

Wor o NOTI continue t preoccup th System Offic-on loo a ou
recentl revise implementatio calenda suggest th problem a almos
infinit variet o task competin fo th attentio o ver finit

After the B option is run:

Work on NOTIS continues to preoccupy the Systems Office--one look at our
recently revised implementation calendar suggests the problem: an almost
infinite variety of tasks competing for the attention of a very finite

--------------------------------------------------------------------------
T - total words & lines in file. Output file is optional.
If you do not want the information written to an output file,
press RETURN when asked for output file name.

File processed: QUICKSTART
Number of lines: 4
Number of words: 30

---------------------------------------------------------------------------
W - extract unique words from input file. Creates sorted list of
these words in the output file. Beginning with release 1.0e these
words list to your output file 1 word to a line.

an at can desired do
dos enter file for gtu
hold input of opening option
output process processing prompt quickstart
results screen select shows sorts
the then things to you

--------------------------------------------------------------------------
Z - Zap Multiple blank lines.

This option is used primarily to shorten files ...files that have many
blank lines in them. For example, often you'll receive
documentation files that are formatted for printing...each page is
padded out with blank lines to fill a page. Option Z will remove the
2nd through nth blank lines in a contiguous run...producing a file that
prints out requiring less paper.

---------------------------------------------------------------------------
G - Go from ASCII -> WordStar.

This option removes the hard carriage return from within paragraphs.
Spaces before text are padded out with soft spaces. Running an ASCII
file through GTU with the G option allows you to then reformat the
document under WordStar. This option is particularly useful for
OCR applications. Here's the effect of the G option on the
QuickStart paragraph:

Before:

QUICKSTART: Enter GTU at the DOS prompt. The opening screen shows the
sorts of things GTU can do for you. Enter an input file to process, an
output file to hold the results of the processing, then select the desired
processing option.

After:

QUICKSTART Ente GT a th DO prompt Th openin scree show the
sort o thing GT ca d fo you Ente a inpu fil t process an
outpu fil t hol th result o th processing the selec th desired
processin option.

It looks ok under WordStar...
---------------------------------------------------------------------------
Q - quick SORT of lines in input file:

QUICKSTART Enter GTU at the DOS prompt. The opening screen shows the
output file to hold the results of the processing, then select the desired
processing option.
sorts of things GTU can do for you. Enter an input file to process, an

Note: Files longer than 625 lines will not be processed. Further, if
any line is longer than 85 characters, processing terminates.
Sort order is strict ASCII (thus, upper case letters sort before
lower case). If you want a case-insensitive sort, use GTU to first
convert the file to all upper or all lower case.

-------------------------------------------------------------------------
D - DETERMINE Character Frequency.

A rather interesting option, D is particularly useful if you're considering
data compression...there may be other uses but I haven't thought of one...

Here's the report from our sample paragraph (named TEST.DOC) for this
illustration:

Character frequency for file: TEST.DOC. Characters read: 241

Character Frequency % of file

Space:4016.598
,20.830
.31.245
:10.415
A52.075
C72.905
D52.075
E249.959
F52.075
G62.490
H104.149
I104.149
K10.415
L52.075
M10.415
N145.809
O197.884
P93.734
Q10.415
R124.979
S187.469
T2510.373
U83.320

W10.415
Y10.415

The count of characters is NOT case sensitive; that is, 'a' and 'A' will be
reported in the A column. Values of 0 for a given character are not
reported.

--------------------------------------------------------------------------
E - Extend/Chop lines

This option will pad or chop all lines in a file to a given length. For
example, if you want all lines in your output file to be 100 characters,
GTU will read your input file and add spaces to the lines less than 100
and chop down to 100 characters, the lines that are longer.
If GTU is chopping lines (say reducing all lines to 50 characters or less)
it will wrap words that exceed the line limit to the next line. No information
will be lost.

Here is the above paragraph when put through GTU's E option with a right
margin of 50:

This option will pad or chop all lines in a file
to a given length. For example, if you want all
lines in your output file to be 100 characters,
GTU will read your input file and add spaces to
the lines less than 100 and chop down to 100
characters, the lines that are longer. If GTU is
chopping lines (say reducing all lines to 50
characters or less) it will wrap words that exceed
the line limit to the next line. No information
will be lost.

---------------------------------------------------------------------------
I - Invert lines in a file

Use this option to read in file 1 starting at the end, writing to f2 as
it goes along. The final result is to invert the order of the lines of
file f1 in file f2. Uses? Well, if you sort a file then want to have
it in descending order, you could use the I option. Here's the QUICKSTART
paragraph after processing via option 'I':

processing option.
output file to hold the results of the processing, then select the desired
sorts of things GTU can do for you. Enter an input file to process, an
QUICKSTART: Enter GTU at the DOS prompt. The opening screen shows the


---------------------------------------------------------------------------
J - Collapse runs of spaces to a single space (option J only because at
this point we're running out of letters)...

Before:

QUICKSTART: Enter GTU at the DOS prompt. The opening screen shows the sorts
of things GTU can do for you. Enter an input file to process, an output file
to hold the results of the processing, then select the desired option.

After:

QUICKSTART: Enter GTU at the DOS prompt. The opening screen shows the sorts
of things GTU can do for you. Enter an input file to process, an output file
to hold the results of the processing, then select the desired option.

Note extra space between the 1st and 2nd sentence removed. Anywhere more than
1 space occurs, under the J option, GTU will replace it with a single space.
As you might expect, this option will play havoc on text files with columns!



IV. SYSTEM-WIDE LIMITATIONS

Generally speaking, there are few limits to the program. Only options
C (Center), X (Extract Unique Words) and Q (QuickSort lines in file)
have specific limiting parameters.

Option C - no line longer than 80 characters. If you have a line
longer, program will terminate.

Option X - No more than 625 unique words. No word longer than 85
characters.

Option Q - No more than 625 lines in file. No line longer than
85 characters.

-------------------------------------------------------------------
V. REVISION HISTORY

Version Description

1.4 Chop/Extend function changed. Now when chopping lines to a
given length, any leftover words will be wrapped to the
next line in the output file. NO DATA WILL BE LOST.
Code in several other functions improved dramatically.

Pad left w/ spaces changed to variable (user-defined)
number of spaces.

Option J (replace runs of spaces) added.

1.3 Internal use. Not distributed.

1.2 Hack spaces off end of line
1.1 Color added to program for CGA/EGA systems. Original video
mode restored on exit.
Bug in Pull Flush left fixed.
Program action for all functions standardized--more or less.
1.0i Invert lines function (Option I).
1.0h Minor bug fixed on opening screen border.
1.0g Extend/Chop function (E) added.
1.0f Character frequency (D) option added.
1.0e Z and G options added. WordStar -> ASCII conversion
improved (control codes now removed).
Unique word list now writes a single word to a line.
1.0d mSORT changed to ZipSort (Zipsort also part of ZipKWIC system).
1.0c Internal coding streamlined, 500 bytes shaved off EXE file.
mSORT utility program added to GTU package.
1.0b Opening menu/instruction screen improved. Option B added.
1.0a Option N (add line numbers to output file) added.
1.0 Initial release.

--------------------------------------------------------------------

Questions, comments, complaints, etc.

Waldo Grotophorst, Library Systems Office
Fenwick Library, George Mason University
4400 University Drive, Fairfax, VA 22030
(703) 993-2239

GMUtant OnLine BBS: 703-993-2219 1200/2400/9600 v.32 24 hours a day

BITNET: [email protected]


 December 6, 2017  Add comments

Leave a Reply