The following table details the effect of the
getline. fgetline. srchrecord and fsrchrecord
functions on $0, the field variables, $i, and the built-in variables, NF,
NR and FNR.
|
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: The function parameters
sp and rs have not been shown in srchrecord and fsrchrecord
to highlight the similarity with the functions getline and fgetline
and their effect on the variables indicated.
Note: FNR and NR
are updated to their proper and correct values whenever the basic QTAwk
processing loop reads the next input record from the current input file
or when the getline or srchrecord functions are executed.
Note: If the record number of
the record read by the fgetline or fsrchrecord functions
is desired, the get_FNR function must be used.