[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
8. Arrays in awk
An array is a table of values called elements. The elements of an array are distinguished by their indices. Indices may be either numbers or strings.
This chapter describes how arrays work in awk
,
how to use array elements, how to scan through every element in an array,
and how to remove array elements.
It also describes how awk
simulates multidimensional
arrays, as well as some of the less obvious points about array usage.
The chapter moves on to discuss gawk
’s facility
for sorting arrays, and ends with a brief description of gawk
’s
ability to support true multidimensional arrays.
awk
maintains a single set
of names that may be used for naming variables, arrays, and functions
(see section User-Defined Functions).
Thus, you cannot have a variable and an array with the same name in the
same awk
program.
8.1 The Basics of Arrays | The basics of arrays. | |
8.2 The delete Statement | The delete statement removes an element
from an array.
| |
8.3 Using Numbers to Subscript Arrays | How to use numbers as subscripts in
awk .
| |
8.4 Using Uninitialized Variables as Subscripts | Using Uninitialized variables as subscripts. | |
8.5 Multidimensional Arrays | Emulating multidimensional arrays in
awk .
| |
8.6 Arrays of Arrays | True multidimensional arrays. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |