Go forward to Built-in Summary.
Go backward to Variables/Fields.
Go up to Variables/Fields.
Fields
------
As each input line is read, `gawk' splits the line into FIELDS,
using the value of the `FS' variable as the field separator. If `FS'
is a single character, fields are separated by that character.
Otherwise, `FS' is expected to be a full regular expression. In the
special case that `FS' is a single blank, fields are separated by runs
of blanks and/or tabs. Note that the value of `IGNORECASE' (
see Case-sensitivity in Matching: Case-sensitivity.) also affects how
fields are split when `FS' is a regular expression.
Each field in the input line may be referenced by its position, `$1',
`$2', and so on. `$0' is the whole line. The value of a field may be
assigned to as well. Field numbers need not be constants:
n = 5
print $n
prints the fifth field in the input line. The variable `NF' is set to
the total number of fields in the input line.
References to nonexistent fields (i.e., fields after `$NF') return
the null-string. However, assigning to a nonexistent field (e.g.,
`$(NF+2) = 5') increases the value of `NF', creates any intervening
fields with the null string as their value, and causes the value of
`$0' to be recomputed, with the fields being separated by the value of
`OFS'.
See Reading Input Files: Reading Files, for a full description of
the way `awk' defines and uses fields.