Is there a way to get awk to return the number of fields that met a field-separator criteria? Say, for instance, my file contains
a b c d
so,
NF gives the number of fields for a given record:
NF
[]$ echo "a b c d" | gawk '{print NF}' 4