home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 11
/
AUCD11B.iso
/
LANGUAGES
/
WraithSet
/
AwkStuff
/
Awkify
/
ReadMe
< prev
next >
Wrap
Text File
|
1999-12-15
|
5KB
|
131 lines
****** Awkify v.2 16/9/99 ******
Awk is a classic text manipulating utility. This package
Awkify augments StrongED (versions >= 4.54) with all the
power of awk, using StrongED's unexploited "Process"
command. It uses GNU Awk v.3.0.4. I am indebted to
John Kortink for help in compiling the gawk binary.
Three extra functions have been built in specifically
for use under Risc OS. See the file "Riscos" for details.
You can either consider this an enhancement of StrongED
or as the provision of a windowing user interface for
programming in Awk.
It is presumed that you have a copy of !StrongED with version
number >= 4.54.
Installation
------------
If you are nervous make a backup copy of !StrongED first.
Only the files
!StrongED.!Boot
!StrongED.Resources.!Sprites
!StrongED.Resources.!Sprites22
!StrongED.Resources.Sprites
!StrongED.Resources.Sprites22
!StrongED.Defaults.Modes.BaseMode
!StrongED.Defaults.ModeWhen
get modified.
1. Copy the file "gawk" into !Boot.Library or to some place
in your Run$Path list.
2. Modify !StrongED as follows:
1) Double click on the spritefile AwkSprite and copy
the sprite "file_0a0" into !StrongED.Resources.!Sprites
and !StrongED.Resources.!Sprites22. This gives an
icon for the "awk" filetype.
2) Double click on the spritefile ResSprite and copy
the sprites "see" and "runawk" into !StrongED.Resources.Sprites
and !StrongED.Resources.Sprites22. This gives two new
toolbar icons.
3) Append the contents of !Boot+ to !StrongED.!Boot.
4) Open the textfiles BaseM+ and !StrongED.Defaults.Modes.BaseMode.
Copy from BaseM+ the line
CR &0d
into the section "clicklist related entries" in BaseMode.
Copy the remaining uncommented lines of BaseM+ into the
section "Toolbar and mode-menu functions" in BaseMode.
5) Append the contents of ModeW+ to !StrongED.Defaults.ModeWhen.
6) Copy the directory Modes over !StrongED.Defaults.Modes.
This will add another mode called "awk".
7) Copy the directory Tools over !StrongED.Tools.
This will add four files: "blank" (a default awk program
that does nothing), and three obey files "awkapply",
"awkrun" and "setawk".
8) If StrongEd is already running, choose quit from the iconbar
icon and restart it.
What this will do
-----------------
Booting StrongED will create a new filetype (0x187) called
"awk". You will find that StrongED has a new mode "awk" for awk
files, and every mode has two new functions "See" and "Runawk".
As usual these can be operated either from the Menu button
or by clicking smarticons on the toolbar.
Clicking on the "see" icon will display the current awk program.
Clicking on the "runawk" icon will apply the current awk program
to the text in the window. Use Select to send the output to a new
file, called "out", in the same directory as the input file, and
to open a StrongEd window containing it. Use Adjust to replace
the contents of the window with the output (this is slightly
more dangerous because if you click Save the input file will
be overwritten by the output).
When StrongED starts, the current awk program is held in the
file !StrongED.Tools.blank. It consists of the single line
1
(the shortest program in the world?) and its effect is to
leave text alone. If you create an awk program in a StrongED
window in awk mode, save it somewhere and click the "Run"
toolbar icon, then it becomes the current awk program.
Doubleclicking on any file of type "awk" makes it the current
awk program. Three short example awk programs are in the
directory Examples.
Manifest
-------
gawk -- gawk binary, a port of GNU awk 3.0.4
AwkSprite -- sprite for awk filetype
ResSprite -- contains two new smarticons, 'see' and 'runawk'
!Boot+ -- extra lines for !Boot
BaseM+ -- extra lines for BaseMode
ModeW+ -- extra lines for ModeWhen
ReadMe -- this file
Riscos -- details of extra built in functions
Modes
awk -- awk mode
Tools
blank -- default current awk program
awkapply -- obey file for applying current awk program with Select
awkrun -- obey file for applying current awk program with Adjust
setawk -- obey file for setting current awk program
Examples
nodup -- remove duplicate lines of text.
number -- number the non-blank lines of text.
words -- list all the separate words in the text in the
order in which they first occur.
Information about awk
---------------------
The FAQ list for comp.lang.awk can be found on the Internet:
<ftp://rtfm.mit.edu/pub/usenet/comp.lang.awk/faq>
<http://www.faqs.org/faqs/computer-lang/awk/faq/>
The sources can be found in
ftp://prep.ai.mit.edu/pub/gnu/gawk-3.0.4.tar.gz
An introductory text can be found at
http://www.ssc.com/lj/issue25/1156.html
-- G.C.Wraith
mailto:gavin@wraith.u-net.com