[ale] Riddle me this awk man

Björn Gustafsson bg-ale at bjorng.net
Thu Feb 17 23:10:52 EST 2011


It is probably an off by one error/CRLF difference.  If you skip the
first five delimiters, and there are only five fields, then there are
only four spaces on the line.  In cygwin, you skip over the carriage
return (byte 5) but still have the line feed.

On Thu, Feb 17, 2011 at 10:22 PM, Greg Freemyer <greg.freemyer at gmail.com> wrote:
> 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
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>



-- 
Björn Gustafsson



More information about the Ale mailing list