[ale] Riddle me this awk man

Geoffrey Myers lists at serioustechnology.com
Thu Feb 17 21:03:30 EST 2011


Geoffrey Myers wrote:

> I still wonder whether it's something to do with the actual number of 
> fields.  If the lines that you think have a single field end or begin 
> with a space, awk will think there is a null field.

Okay, the above assumption is wrong, but the below I think is your 
issue.  NR == 1 only for the first record.

> 
> Wait a minute.  Should you be using NF not NR?  NF == number of fields
> NR == number of records.


-- 
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson


More information about the Ale mailing list