Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jul 2007 09:28:19 +0200
From:      "n j" <nino80@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: awk question
Message-ID:  <92bcbda50707270028r79a8a706r37ca096bdb793001@mail.gmail.com>
In-Reply-To: <200707262151.l6QLpm9f068503@dc.cis.okstate.edu>
References:  <200707262151.l6QLpm9f068503@dc.cis.okstate.edu>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
> >     > awk '{print $(NF-1)}' user.csv
>
> Yup, those blank lines will kill it for sure. A sed filter to
> remove blank lines ahead of the awk statement should allow it to
> work properly.

Or awk only i.e. no sed:

awk '!(/^$/) { print $(NF-1) }' user.csv

-- 
Nino



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?92bcbda50707270028r79a8a706r37ca096bdb793001>