Last edit
Summary: example added
Changed:
< The [[expression]] $NF is used to refer to the last [[field]] in the [[current record]].
to
> The [[expression]] $NF is used to refer to the last [[field]] in the [[current record]]. The following [[script]] outputs the first and last [[field]] from each [[record]]:
> {{{
> awk '{ print $1,$NF }' filename
> }}}
The special variable NF holds the number of fields in the [[current_record?]].
The [[expression?]] $NF is used to refer to the last field in the [[current_record?]]. The following [[script?]] outputs the first and last field from each record:
awk '{ print $1,$NF }' filename