[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Riddle me this awk man



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