QTAwk has been designed to make it easy for the average user to create those small, or maybe not so small, utilities needed to accomplish small, or not so small, everyday jobs. The jobs which are too small to justify the time and cost of using the traditional computer programming language and maybe hiring a professional programmer to accomplish.
If you are like many computer users, you would frequently like to make changes in various text files wherever certain patterns appear, or extract data from parts of certain lines while discarding the rest. To write a program to do this in a language such as C or Pascal is a time-consuming inconvenience that may take many lines of code. The job may be easier with QTAwk.
The QTAwk utility interprets a special-purpose programming language that makes it possible to handle simple data-reformatting jobs easily with just a few lines of code.
This manual teaches you what QTAwk does and how you can use QTAwk effectively. Using QTAwk you can:
This online document presents a description of the QTAwk utility creation tool and its use. Most computer users have many small tasks to accomplish that are usually left undone for lack of the proper tool. Typically these tasks require finding one or more records within a file and executing some action depending on the record located.
In order to accomplish these tasks the user needs a tool which will allow the following to be accomplished easily:
QTAwk supplies the user with all of these features in an easy to use manner. Specifying the name of a file is all the user need do to open the file and read it record by record. The user may easily change what a "record" is or let it default to an ASCII text line as used by all text editors and which can be written by all word processors. The user may also force QTAwk to view files as sequences of fixed length records. QTAwk will automatically split (parse) records into fields. Initially a field is a word or a sequence of nonblank characters. The user may change the definition of a field easily to adapt to the needs of a particular situation. The user may even force QTAwk to split input records into fixed length fields.
Arithmetic expressions, logical expressions or regular expressions may be used to define the criteria for selecting records for action. Regular expressions are a powerful means of describing the criteria for selecting, i.e, matching, the text of records. Arithmetic expressions utilize the ordinary arithmetic operators (addition, subtraction, multiplication, etc.) for describing the criteria for selecting records and logical expressions utilize the logical operators (less than, equal to, greater than, etc.) for selecting records.
Of all the operators available in QTAwk, the regular expression operators may be only ones most readers are not familiar with. Regular expressions are a powerful and useful tool for working with text. Yet for all their power, they are surprisingly simple and easy to use when learned. The Regular expressions section of this document explains regular expressions fully, in a manner that will make them usable by a person totally unfamiliar with them.
QTAwk is patterned after The Awk Programming Language by Alfred V. Aho, Brian W. Kernighan and Peter J. Weinberger. The Awk program implementing The Awk Programming Language is available on most Unix (tm) systems. Aho, Kernighan and Weinberger invented the automatic input loop and the pattern-action pairs used in QTAwk and are to be heartily congratulated for this. Without Awk, QTAwk would not exist. QTAwk is an extensive expansion of The Awk Programming Language in many important aspects. In addition, some of the admitted shortcomings of The Awk Programming Language have been corrected. Differences From AWK contains a detailed listing of the differences between QTAwk and Awk. History lists the changes to QTAwk with each version.