User Guide
Chapters
Table of Contents
Limits
Differences From AWK

History


Version 6.22/1.22
Version 6.21/1.21
Version 6.10/1.10
Version 6.00/1.00
Version 5.11
Version 5.10
Version 5.00
Version 4.20
Version 4.10
Version 4.02
Linux Version 1.30

History

QTAwk Update History

Version 6.22/1.22

==> QTAwk Versions 6.22 for DOS and version 1.22 for OS/2, dated 11/14/96. This version contains two changes from the previous versions:

  1. The date/time functions
  2. sdate
  3. stime
  4. jdn
  5. cal
  6. have been replaced with the date/time functions

    1. _time - this function returns the current system time as seconds since midnight. This function takes no parameters and may be invoked with or without the function parenthesis.
    2. _ftime - this function returns the specified date/time formated according to the specified format string. This function has two forms
    3. _ftime(fs) - return the string representing the current system date/time formatted according to the format specification in 'fs'.
    4. _ftime(fs,sjdn,stime) - return the string representing the date/time specified in the Julian Day Number, 'sjdn', and time, 'stime', formatted according to the the format specification in 'fs'.
    5. jdn - this function is the Julian Day Number function of previous versions, except that the optional form to pass a file date has been changed. The forms of the 'jdn' function are now
    6. jdn() or jdn - returns the Julian Day Number for the current system date.
    7. jdn(sjdn) - returns an array with the calender date for the Julian Day Number specified, sjdn. The returned array has the following elements
      • array[0] == year
      • array[1] == month
      • array[2] == day
    8. jdn(year,month,day) - returns the Julian Day Number for the calender date specified.
  7. The 'findfile' function has been changed slightly. The file dates and times are no longer returned in operating system specific formats. The file dates are now returned as Julian Day Numbers and the file times are returned as seconds since midnight. Thus, both file dates and times can be used directly in the new '_ftime' function and the file date can be used in the 'jdn' function

Version 6.21/1.21

==> QTAwk Version 6.21 for DOS and version 1.21 for OS/2, dated 05/01/96. This version contains several changes and additions from the previous versions:

  1. The tagged string operator has been changed and renamed the tag operator. The tag operator has been changed from '$$' operating only on the input record to '[< >]' operating on any variable.

    The changed tag operator has the same level of operator precedence as before.

  2. Fix the 'for' statement so that the common idiom:

    for (;;)

    works.

  3. Fix the 'system' function to flush the buffers of all files opened for output, including the standard output files, prior to calling the Operating System command interpreter with the string passed.
  4. Fix the 'split' function and the operation of the field splitter built-in variable, FS, so that if the first field separator starts the current input line or the target string of 'split', then the first 'field' returned by both is a null string. The only exception to this rule is if FS is the default separator, then leading and trailing white space on the current input line and the 'split' target string is ignored and the first 'field' starts with the first non-white space character.
  5. Add 'fflush' built-in function. This function allows the user to explicity control flushing the output buffer of output files. The function has three forms:
    1. fflush(filename) - flush the output buffer of the output file named.
    2. fflush() - flush the output buffer of the standard output file, 'stdout', normally the console display, but may be redirected by the Operating System.
    3. fflush("") - flush the output buffers of all files opened for output, including the standard output file.
  6. Add built-in generalized substitution function, gensub. This function joins the previous substitution functions sub and gsub. The new function has two forms. The generalized substitution function differs from the 'sub' and 'gsub' functions, however, in that the target string passed to the function remains unchanged, the changed string with any substitutions made is returned by the function. If no substitutions have been made, then a copy of the target string is returned.
    1. gensub(re, rs, how) - search the target string, $0, for matches to the replacement expression, re. Replacements are made with the replacement string, rs. The how parameter determines the number of replacements made and which matching string to replace, using the following rules:
      1. If how is a string, including a regular expression or a single character, which starts with the character 'g' or 'G', then all matches are replaced.
      2. If how is a string, including a regular expression or a singler character, not starting with 'g' or 'G', then the first match only is replaced and no search for matches beyond the first is made.
      3. If how is a numeric greater than zero, 0, then the numbered match equal to how is replaced only. For example, if:

        how == 3

        then only the third match found is replaced. In addition, no further searches for matches are made.

      4. If how is a numeric equal to zero, then no search for matches is done and no replacements are made.
      5. If how is a negative numeric, then it is treated as though

        how == 1

        and only the first match is replaced and no search for matches beyond the first is made.

    2. gensub(re, rs, how, ts) - search the target string, ts, for matches to the replacement expression, re. Replacements are made with the replacement string, rs. The how parameter determines the number of replacements made and which matching string to replace, using the same rules as for the first form of 'gensub' above.

    Using "gensub", the count of substitutions can still be obtained under QTAwk quite easily. Since QTAwk does not evaluate the replacement string expression at the time the "gensub" function is called, but delays evaluation until the replacement is done, the following construction, counts the number of substitutions made.

    gcnt = 0;
    gensub(re, (gcnt++, rs), how[, target]);

    The comma operator has been used in the second argument to increment the count variable, gcnt, every time a replacement is made. Note that if how is a numeric, then the final value of gcnt will be equal to the number of matches found or to the value specified for how, whichever is less. Note also that the second argument, (gcnt++, rs) MUST be enclosed in parenthesis.

Version 6.10/1.10

==> QTAwk Version 6.10 for DOS and version 1.10 for OS/2. 05/01/96. This version contained bug fixes only and was quickly superceded by versions 6.20 (PC/MS-DOS) and 1.20 (OS/2).

Version 6.00/1.00

==> QTAwk Version 6.00 for DOS and version 1.00 for OS/2, dated 05/01/94. This version contains several changes and additions from the previous versions:

  1. Arrays have been fully integrated into the match operators, ~~ and !~, both their direct use and their implied use in patterns and as arguments of the functions match, gsub, sub, and split. The use of an array as the operand of a match operator will match against all elements of the array as separate regular expressions. This is similar to the use of the GROUP keyword in patterns.

    If a match is found, the new variable MATCH_INDEX is set to the string value of the index in the array of the matching regular expression. If a multidimensional array is used, the array indices are separated by the value of the built-in variable SUBSEP (which has been re-introduced from Awk with a slightly different use).

    In addition, the use of arrays for the built-in variables RS and FS enables the user to specify multiple regular expressions for use as record separators and/or field separators. The use of arrays for RS and/or FS does not affect the value of MATCH_INDEX.

    Arrays used for regular expression matching retain their internal regular expression form until the whole array or an array element is changed. Thus arrays can be be used as dynamic regular expressions for which the user controls when the internal form is changed.

  2. New algorithms have been developed and used for regular expression matching. A total of four different algorithms are used for pattern matching. QTAwk automatically selects the appropriate algorithm to optimize the search depending on the regular expression(s) to be matched. The algorithm used is selected based on the number of regular expression(s) to match and the complexity of the regular expression(s).
  3. The new variable MATCH_INDEX is defined. This variable is set to the string value of the index of the matching element when an array is used for matching.
  4. The variable SUBSEP from Awk is re-introduced with a default value of a comma character, ','. The value of SUBSEP is used to separate the index values in MATCH_INDEX when a multidimensional array is used for matching.
  5. A new method of file processing has been introduced. In the current and previous versions, the following process is carried out:
    1. Determine next record according to RS or RECLEN
    2. Read next record,
    3. Parse record into fields according to FS or FIELDWIDTHS
    4. Execute each pattern expression
      1. If pattern expression is TRUE, execute associated action

    For QTAwk utilities in which all patterns contain a regular expression match or for those files for which actions are executed only for those records matching a set of one or more regular expressions, the above process for each record can be time consuming. It would be much faster to scan the input file for matches to the desired regular expression(s) and then execute each pattern expression once such a record has been found. This process by-passes the time consuming process of reading individual records and parsing each into fields. Only the desired records need to be read and parsed with the new method, thus saving much time in the execution of the QTAwk utility.

    QTAwk Version 6.00 and version 1.00 for OS/2 implements the new search method. Two new variables:

    1. FILE_SEARCH
    2. FILE_SEARCH_PAT

    have been introduced for this purpose. When FILE_SEARCH is TRUE, the next record read will be the record matching a regular expression from FILE_SEARCH_PAT. If FILE_SEARCH is FALSE, the normal file input process described above is followed. The new file search process may be turned on and off as necessary for a single input file in this manner.

    FILE_SEARCH_PAT is set by the user utility to one or more regular expressions against which records from the current input file are matched. FILE_SEARCH_PAT may be set to a single regular expression as a simple variable, e.g.,

    or a singly dimensioned array, e.g.,

    or a multidimensioned array, e.g.,

    When FILE_SEARCH is TRUE, the current input file is scanned for a match to FILE_SEARCH_PAT. When a record is found matching a regular expression in FILE_SEARCH_PAT, the record is read, parsed into fields according to FS or FIELDWIDTHS and each pattern expression executed. The associated actions for TRUE pattern expressions are executed. Note that the variables RS or RECLEN still determine the parsing of the input file into records.

    Under some circumstances, the above process can return in '$0' multiple records from the current input file. In searching the input file for a match to FILE_SEARCH_PAT, a match may span more than one record if the new variable, SPAN_RECORDS, is TRUE. In this case, '$0' is set to the full set of records spanning the match to FILE_SEARCH_PAT. If SPAN_RECORDS is FALSE, any matches to FILE_SEARCH_PAT are not allowed to span input records and '$0' will contain only a single record.

  6. The new variable FILE_SEARCH is defined
  7. The new variable FILE_SEARCH_PAT is defined
  8. The new variable SPAN_RECORDS is defined
  9. The action of QTAwk when NF is changed now reflects the intuitive effect of changing NF. If the new value is greater than the current value, the current input line is lengthened with new empty fields separated by the output field separator string, OFS. If the new value is less than the current value, the current input line is shortened by truncating at the end of the field corresponding to the new NF value.
  10. Two new input functions have been introduced:
    1. srchrecord(sp)
      srchrecord(sp,rs)
      srchrecord(sp,rs,var)

      is similar to the function getline. srchrecord will search the current input file for the next record or records matching the search pattern, 'sp'. If the record separator parameter, 'rs', is not specified, records are determined by the variable RS or RECLEN. If 'rs' is specified, record boundaries are determined by the strings matching 'rs'. 'rs' may be a simple constant or variable or an array. The record or records matching the search pattern are returned in '$0' if 'var' is not specified. If 'var' is specified, the matching record or records are returned in 'var'. The built-in variables, FNR and NR are updated to reflect the current position and record number after the search. The built-in variables, NF and '$i', i <= 0 <= NF, are set when 'var' is not specified.

    2. fsrchrecord(file)
      fsrchrecord(file,sp)
      fsrchrecord(file,sp,rs)
      fsrchrecord(file,sp,rs,var)

      is similar to the function fgetline. fsrchrecord will search the file specified for the next record or records matching the search pattern, 'sp'. If the record separator parameter, 'rs', is not specified, records are determined by the variable RS or RECLEN. If 'rs' is specified, record boundaries are determined by the strings matching 'rs'. 'rs' may be a simple constant or variable or an array. The record or records matching the search pattern are returned in '$0' if 'var' is not specified. If 'var' is specified, the matching record or records are returned in 'var'. The built-in variables, NF and '$i', i <= 0 <= NF, are set when 'var' is not specified.

    Both functions have identical returns to the getline and fgetline functions, i.e.,

    1. the number of characters in the record(s) matched plus the End-Of_Record length plus 1
    2. zero, 0, if End-Of-File was reached before finding a match
    3. -1 on a file read error.

    getline() getline(v) fgetline(F) fgetline(F,v)

    srchrecord() srchrecord(v) fsrchrecord(F) fsrchrecord(F,v)





    $0 updated not updated updated not updated
    $i, i>0 updated not updated updated not updated
    NF updated not updated updated not updated
    NR updated updated not updated not updated
    FNR updated updated not updated not updated

    Note

  11. The new function get_FNR has been introduced. This function returns the current record number for the file specified. The two forms are:
    1. get_FNR()

      This form returns the current record number of the current input file. The value returned is equal to the built-in variable FNR.

    2. get_FNR(filename)

      This form returns the current record number of the input file specified. If filename == FILENAME, this form is equivalent to the first form. If the filename specified is not open or is not open for input, a value of zero, 0, is returned.

    This function has been added because of the input functions fgetline and fsrchrecord. For the current input file, the built-in variable FNR is always updated automatically to contain the record number of the last record input (the current record). However, when reading from a file other than the current input file, previously there was no means of obtaining the current record number of the input file. With fgetline, the user utility could maintain an independent count of records read. However, if the fsrchrecord function is used, there is no other means of obtaining the record number of the last record read.

  12. The function resetre has been introduced. In previous versions, once a regular expression has been used to search for a match, the internal form of the regular expression is set and could not be changed. If the regular expression contained embedded named expressions and the value(s) of the corresponding variables changed, the new values of the variables could not be incorporated into the regular expression. This improved the speed of scanning since the regular expressions did not have to be converted to internal form for each use. To obtain the variability needed for changing variable values, strings were used for matching. For match expressions which change frequently, strings used for match operators are still the better choice, since they are converted to internal form for each use. However, for those occasions where the match expression changes infrequently due to the change in value of embedded named expressions, the use of a string leads to impaired performance. This function has been introduced for just such use. This function releases the internal form of all regular expressions so that the next time it is used as the search pattern for a match operation, the internal form is rebuilt using the then current values of any variables used in named expressions.

    Note that the use of arrays for match patterns falls between the use of strings, for which the internal regular expression form is rebuilt for each use, and regular expressions for which the internal form is built for the first use and then remains static. When arrays are used for matching, the internal regular expression form is built when first used and retained until the array is changed. For arrays the internal regular expression form is assigned when the array as a whole is assigned to another variable. Thus the internal regular expression form can be retained and reused.

  13. The new variable FILEATTR is defined. This variable contains the attributes of the current input file in a string. The string defines the attributes in the same manner as the variable for the findfile function defines the attributes for the files found by that function.
  14. The new variable FILEDATE is defined. This variable contains the date of the current input file in the operating system format. The time, ftime functions may be used to format the date.
  15. The new variable FILEPATH is defined. This variable contains the drive and path of the current input file. The path string ends with the subdirectory separator character.
  16. The new variable FILESIZE is defined. This variable contains the size in bytes of the current input file.
  17. The new variable FILETIME is defined. This variable contains the time of the current input file in the operating system format. The sdate, ftime functions may be used to format the time.
  18. The following built-in variables have been added for the OS/2 version:
    1. FILECDATE - date of file creation as returned by the Operating System.
    2. FILECTIME - time of file creation as returned by the Operating System.
    3. FILEADATE - date of last file access as returned by the Operating System.
    4. FILEATIME - time of last file access as returned by the Operating System.
  19. The functions sdate and stime have been changed from previous versions. The fixed formats supported by previous versions have been replaced by the use of a format string identical to that supported by ANSI C. The forms are:
    1. sdate(frmt_strg) return string formatted according to 'frmt_strg' using current system date and time.
    2. sdate(frmt_strg,fdate) return string formatted according to 'frmt_strg' using date specified in fdate and current system time. fdate is a file date in the operating system format.
    3. sdate(frmt_strg,year,month,day) return string formatted according to 'frmt_strg' using date specified in 'year', 'month' and 'day' and current system time.
    4. stime(frmt_strg) return string formatted according to 'frmt_strg' using current system date and time.
    5. stime(frmt_strg,ftime) return string formatted according to 'frmt_strg' using time specified in ftime and current system date. ftime is a file time in the operating system format.
    6. stime(frmt_strg,hour,minute,second) return string formatted according to 'frmt_strg' using time specified in 'hour', 'minute' and 'second' and current system date.
  20. The functions jdn and 'cal' have been modified. 'jdn' computes the Julian Day Number for an associated date. 'cal' computes the date for a given Julian Day Number. The Julian Day Number is very useful in date computations.
  21. The new command line option, "-Ww filename", has been introduced. This option allows the user to write the internal form of a utility to the specified file. The internal form may then be specified with the "-f" option. Reading the internal form of a utility in this manner can greatly speed the initial execution of the utility.
  22. The command line switch '-Wd' has been introduced. This switch causes QTAwk to set the built-in variable DELAY_INPUT_PARSE to true.
  23. The following built-in variables have been added:
    1. MATCH_INDEX - see the description of the expanded sub and gsub functions.
    2. CONVFMT - specifies the format used to convert floating point values to a string value. Previously the value of OFMT was used for this purpose. OFMT is now used only for formatting floating point values for output.
    3. IGNORECASE - if assigned a true value, QTAwk ignores alphabetic case in all match operations against strings and regular expressions. This is true for all built-in functions using regular expressions and in searches for record terminator and field terminator strings using RS and FS respectively.
    4. RT - Contains the full string value of the record terminator of the current input record. If the value of RS is not changed, this always contains a single new line character. If the value of RS is changed to an array or a regular expression, then the record terminator can change with each input record. The value of RT gives the user access to the current value of the terminator.
    5. RECLEN - used to specify the length of fixed length records. If RECLEN has an integral non-zero value, the value is used to read the next record and RS is ignored. When RECLEN is used to determine input records, RT is always set to the null string.
    6. FIELDWIDTHS - when assigned a string value containing space separated integral numbers of the form:

      n1 n2 n3 ... nn

      the splitting of input records into fields is governed by the numbers in FIELDWIDTHS rather than FS. Each number in FIELDWIDTHS specifies the width of a field including columns between fields. If you want to ignore the columns between fields, you can specify the width as a separate field that is subsequently ignored. When the value FIELDWIDTHS does not match this form, field splitting is done using FS in the usual manner.

    7. FIELDFILL - used to fill a field when the replacement value is less than the field width. This variable value is used only when field splitting is based on FIELDWIDTHS rather than FS. The default value is a single blank character.
    8. DELAY_INPUT_PARSE - used to delay parsing of the current input record until the value of NF or one of the field variables, $i, 1 <= i <= NF, is needed. The default value is false. If the value is true, then the input record is not parsed until necessary. For utilities which do not reference NF or the field variables, $i, or seldom reference them, delaying the parsing of the input record can speed the execution of the utility significantly.
  24. The command line option "-vvar = value" has been introduced to assign "value" to the variable "var' before execution of the utility starts. This makes the assigned value of "var" available in any BEGIN actions. This option may be used multiple time on the caommand line to assign multiple variables.
  25. The coomand line option "-wfilename" has been changed to "-Wwfilename" to conform to the POSIX specifcation.
  26. The predefined pattern, GROUP, has been expanded to accept any valid QTAwk expression. The expressions in a GROUP pattern are evaluated when the GROUP patterns are first matched against an input line. The expression is evaluated and the result converted to a regular expression. If the result of the expression is an array, the entire array is matched at the corresponding position in the GROUP pattern.
  27. The sub and gsub functions have been expanded. The second argument, the replacement string expression, is no longer evaluated at the time the function is called, but when the replacement string is used for replacement. Since the first argument, the match pattern expression, may now be an array, the value of the built-in variable, MATCH_INDEX, can be affected as matches are made. By delaying the evaluation of the replacement string expression until the replacement is made, the change in MATCH_INDEX can be used to affect the value of the replacement string for each replacement. QTAwk guarantees that the replacement string expression will be evaluated as replacements are made in the text string from left to right. For constant expressions used for the replacement string, this change has no direct effect.
  28. The Tagged string operator, '$$', has been fixed to properly yield the tagged strings.
  29. A new standard file been introduced, keyboard, for unbuffered input directly from the keyboard. The built-in variable ECHO_INPUT also controls echoing of input characters from this "file" to the standard output file.
  30. The returns from the getline and fgetline functions have been altered slightly. The values returned are the same as the new functions srchrecord and fsrchrecord:
    1. the number of characters read plus the length of the End-Of-Record string plus 1,
    2. 0 if End-Of-File was encountered, or
    3. -1 if an error occurred.

Version 5.11

==> QTAwk Version 5.11, dated 03/30/92. This version contains two additions from the previous versions:

  1. The predefined variable FILE_SORT has been added to control the sequence of files returned by the findfile built-in function.
  2. The predefined variable "Gregorian" has been added to control the use of the Gregorian or Julian Calendars in converting to/from dates and Julian Day Numbers by the built-in cal, jdn and sdate functions.

Version 5.10

==> QTAwk Version 5.10, dated 10/01/91. This version contains several changes and additions from the previous versions:

  1. The command line variable setting mechanism:

    variable = value

    has been fixed.

  2. The function "jdn(fdate)" or "jdn(year,month,day)" has been added to compute the Julian Day Number (jdn) of a specified date. The Julian Day Number is very useful for date computations.
  3. The function "cal(jdn,form)" has been added to complement the 'jdn' function above. The "cal" function returns the date corresponding to the specified jdn passed.
  4. The function "findfile" has been added. This function has the following forms
    1. findfile(var)
    2. findfile(var,pattern)
    3. findfile(var,pattern,attributes)

    where:

    1. var == the variable in which to return the array of files found which match the pattern specified
    2. pattern == a string specifying the pattern to match the filenames. Follows the DOS wildcard convention. If no pattern is specified, "*.*" is used.
    3. attributes == a string specifying the desired file attributes

    This function returns the number of files found which match the pattern specified. The file names, sizes, last modify date and times are returned via the variable specified. The file date and time are returned in "DOS format" which is good for sorting purposes, but unreadable. The "stime" and "sdate" functions have been expanded to include the file time and date and format them as desired.

  5. The "sdate" function has been expanded to return the Julian Day Number as a formatting option and can format any specified date as well as the file date returned by the "findfile" function.
  6. The "stime" function has been expanded to be able to format any specified time as well as the file time returned by the "findfile" function.
  7. For format arguments greater than the number of format options the 'sdate' and 'stime' functions no longer terminate execution with an error message. The remainder operator is silently used to obtain a correct formatting option.

Version 5.00

==> QTAwk Version 5.00, dated 02/01/91. This version contains several additions from the previous versions:

  1. The character output functions 'putc(c)' and fputc(c,F)' have been added. These functions are identical in operation to the C functions of the same names. With the 'getc' and 'fgetc(F)' functions of the previous versions, the user now has a complete set of character I/O.
  2. The built-in variable 'ECHO_INPUT' has been added. ECHO_INPUT has a default value of FALSE. If TRUE, when reading from the standard input file, normally the console keyboard, the input is echoed to the standard output file, normally the console display. When the standard input file is re-directed from a file, it is convenient to set ECHO_INPUT to FALSE to prevent echoing each input character to the display.
  3. The variable "QTAwk_Path" has been added. If an environment setting for "QTAWK" exists, QTAwk_Path is set to the value of the setting upon program initiation. This string value is then used in searching for input files. The search sequence for files follows the the order:
    1. If a directory and/or path name name is specified with a file, then that path only is searched.
    2. If no directory or path name is specified, then the current directory is searched. If the file is not found, then all paths specified in QTAwk_Path are searched for the file in the order specified. Multiple paths may be specified, separated by a semi-colon. This follows the same convention for specifying multiple paths in the system environment path setting "PATH".

    The value of QTAwk_Path may be reset at any time by the user's utility to change the paths to be searched for desired files to be opened for reading.

  4. The built-in function 'append(filename)' has been added. Executing this function before any output to "filename" will cause all output to be appended to the end of the file "filename" if it currently exists. Closing the file, "filename", with the 'close' function will cancel the effect of 'append' for any subsequent output to that file.
  5. The tagged string operator, '$$', has been expanded to accept numerical expressions in the forms:
    1. $$0 --> refers to the entire string matched by the last regular expression in the pattern.
    2. $$0.0 --> refers to the entire string matched by the last regular expression.
    3. $$j --> refers to the string matching the regular expression contained in the parenthesis set at nesting level 1 and count j in the last regular expression. Valid values of j are in the range 1 <= j <= 31. Identical to $$1.j of the next form.
    4. $$i.j --> refers to the string matching the regular expression contained in the parenthesis set at the ith nesting level, jth count in the last regular expression. Valid values of i and j are in the range 1 <= i <= 7, 1 <= j <= 31.
    5. $$variable_name --> this form may expand into any one of the previous forms. If the variable operated on by '$$' is a string or regular expression, it is first converted to numeric form.

    Thus $$5.02, is the string matching the regular expression contained within the parenthesis at the fifth level and 2nd count.

Version 4.20

==> QTAwk Version 4.20, dated 10/11/90. This version contains three additions from the version 4.20 previous versions:

  1. The behavior of the RS predefined variable has been changed. It is now similar to the behavior of the FS variable. If RS is assigned a value, which when converted to a string value, is a single character in length, then that character becomes the record separator. If the string is longer in length than a single character, then it is treated as a regular expression. The string matching the regular expression is treated as a record separator. As for FS, the string value is converted to the internal regular expression form when the assignment is made.
  2. Two new functions have been added:
  3. getc() --> reads a single character from the current input file. The character is returned by the function.
  4. fgetc(file) --> reads a single character from the file 'file'. The character is returned by the function.
  5. These functions allow the user to naturally obtain single characters from any file including the standard input file (which would be the keyboard if not redirected or piped).

  6. Error messages now have a numerical value displayed in addition to the short error message. The error messages are listed in numerical order in the QTAwk documentation with a short explanation of the error. In some cases, an attempt has been made to provide guidance as to what may have caused the error and possible remedies. Since the error messages are generated at fixed points within QTAwk and may be caused by different reasons in different utilities during interpretation or during execution on data files, it is not possible to list every possible reason for the display of the error messages. The line number within the QTAwk utility on which the error was discovered and the input data file record number are provided in the error message to provide some help to the user in attempting to ascertain the real reason for the error.

Version 4.10

==> QTAwk Version 4.10. This version contains one addition from the previous versions: version 4.10

  1. In previous versions, the GROUP pattern keyword could accept patterns consisting only of a regular expression constant. For version 4.10, The GROUP pattern keyword has been expanded to accept regular expression constants, string constants and variables. The variables are evaluated at the time the GROUP patterns are first utilized to scan an input record. The value is converted to string form and interpreted as a regular expression.
    GROUP /regular expression constant/ { actions }
    GROUP "string constant" { actions }
    GROUP Variable_name { actions }

    GROUP patterns are still converted into an internal form for regular expressions only once, when the pattern is first used to scan an input line. Any variables in a GROUP pattern will be evaluated, converted to string form and interpreted a regular expression.

Version 4.02

==> QTAwk Version 4.02. This version contains two additions from the previous versions:

  1. The command line argument, double hyphen, "--", stops further scanning of the command line for options. The double hyphen argument is not passed to the QTAwk utility in the ARGV array or counted in the ARGC variable. Since QTAwk only recognizes two command options, this has been included to be compatible with the latest Unix(tm) conventions.
  2. The built-in array ENVIRON has been added. This array contains the environment strings passed to QTAwk. Changing a string in ENVIRON will have no effect on the environment strings passed in the QTAwk "system" built-in function. Environment strings are set with the PC/MS-DOS "SET" command. The strings are of the form:

    name = string

    where the blanks on either side of the equal sign, '=', are optional and depend on the particular form used in the "SET" command. The QTAwk utility may scan the elements of ENVIRON for a particular name or string as desired.



Linux Version 1.30

==> QTAwk Linux Version 1.30. This version contains a correction and an expansion of the built-in variables:

  1. Corrected the action of the "sub", "gsub", and "gensub" functions in replacing the tag operator in the replacement string. Previously the tag operator was replaced after the replacement string expression had been evaluated. In that case, using an expression such as: 'strupr("[<0>]")', where the intent was to convert the matched string to upper case prior to replacement did work as intended. The 'strupr' bultin function operated on the string "[<0>]" which was not the intention. By correcting so that the tag operator was evaluated before the expression as a whole is evaluated, the operation now matches the intent.
  2. The built-in variable array "POSIX" was added. This array contains the strings used in the replacement of the regular expression character classes: [:alpha:], [:alnum:], ... , [:xdigit:]. Since these strings are dependent on the execution locale, this change makes these strings readily available.The array elements are:
    POSIX["alnum"]
    all alphebetic and numeric characters
    POSIX["alpha"]
    all alphebetic characters
    POSIX["blank"]
    the blank and tab characters
    POSIX["cntrl"]
    all control characters
    POSIX["digit"]
    all numeric digits
    POSIX["graph"]
    all visible and printable characters. A tab character is "printable", but not visible. 'a' is both printable and visible
    POSIX["lower"]
    all lower-case alphabetic characters
    POSIX["print"]
    all printable characters
    POSIX["punct"]
    all punctuation characters
    POSIX["space"]
    all white space characters
    POSIX["upper"]
    all upper-case alphabetic characters
    POSIX["xdigit"]
    all hexadecimal numeric digits



TOP
User Guide
Chapters
Table of Contents
Limits
Differences From AWK