[ale] Riddle me this awk man

Greg Freemyer greg.freemyer at gmail.com
Thu Feb 17 22:22:21 EST 2011


Geoffrey,

NR== 1 is just to. ID the header row.

And as I put in the first message I deleted the NR logic and just had
the main print clause.

It still only printed about 1/3rd of the lines.

Fyi;  all the lines have at least 5 fields.  I verifed 5, 6, and 7
field lines work.  So I think this is not a problem with my logic.
Just a awk bug.

Greg

On 2/17/11, Geoffrey Myers <lists at serioustechnology.com> wrote:
> 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
>

-- 
Sent from my mobile device

Greg Freemyer
Head of EDD Tape Extraction and Processing team
Litigation Triage Solutions Specialist
http://www.linkedin.com/in/gregfreemyer
CNN/TruTV Aired Forensic Imaging Demo -
   http://insession.blogs.cnn.com/2010/03/23/how-computer-evidence-gets-retrieved/

The Norcross Group
The Intersection of Evidence & Technology
http://www.norcrossgroup.com


More information about the Ale mailing list