[Home]
HomePage RecentChanges Frequently Asked Questions

NF

Number of Fields

The special variable NF holds the number of fields in the [[current_record?]].

Last 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 

Edit this page View other revisions Administration
Last edited 2011年05月28日 15:14 UTC by markhobley (diff)

Powered by sdf Creative Commons License <pierre.gaston+awk@gmail.com>

Awk Wiki by #awk is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

AltStyle によって変換されたページ (->オリジナル) /