Delete rows from a file...!!

Say i have a file with X rows and Y columns....i see that in some of the rows,some columns are blank (no value set)...i wish to delete such rows....how can it be done?

e.g

181766   100    2009-06-04
184443           2009-06-04
10962    151     2009-06-04
            161     2009-06-04
18858    162     2009-06-04
8179               2009-06-04

Regards
Abhi

To remove rows with less the 3 columns:

awk 'NF>2' file

based on your example: 3 columns have to be there

awk 'NF==3' inputfile > newfile

what if we don know the number of columns ?

---------- Post updated at 05:55 PM ---------- Previous update was at 04:03 PM ----------

let me give the actual scenario...

<HOST>        tcp     127.0.0.1       32852   127.0.0.1       4105    ESTABLISHED     2010-04-06
<HOST>        tcp     *       45301   *       *       LISTEN  2010-04-06
<HOST>        tcp     *       45302   *       *       LISTEN  2010-04-06
<HOST>                                                NULL    2010-04-06
<HOST>        tcp     53.231.196.92   382     53.231.196.92   45357   ESTABLISHED     2010-04-06

As you can see ,in 4th row ,5 out of 8 columns are blank.

I want to delete this row. [There will be hundreds of such rows present in this file ]

Regards
Abhi

Why don't you use the solution of jim mcnamara if you have 8 columns like the shown example?

awk 'NF==8' file

I have no probs in using the provided solution....

My question is : what if you do not know number of columns ?

I have files getting generated every week and some of these files have varying columns in it.A column need not be necessarily present in the file every week.

I simply wanted to automate the task..thats it !!!

nawk 'FNR==NR {nf=(NF>nf)?NF:nf;next} NF==nf' myFile myFile

thanks vgersh99 !!