Go forward to Built-in.
Go backward to Statements.
Go up to Top.
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. Each array has a name, which looks like a variable
name, but must not be in use as a variable name in the same `awk'
program.
Menu
- Array Intro
- Introduction to Arrays
- Reference to Elements
- How to examine one element of an array.
- Assigning Elements
- How to change an element of an array.
- Array Example
- Basic Example of an Array
- Scanning an Array
- A variation of the `for' statement.
It loops through the indices of
an array's existing elements.
- Delete
- The `delete' statement removes
an element from an array.
- Numeric Array Subscripts
- How to use numbers as subscripts in `awk'.
- Multi-dimensional
- Emulating multi-dimensional arrays in `awk'.
- Multi-scanning
- Scanning multi-dimensional arrays.