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

Re: Grep for colums?



On 2009-02-11_12:09:20, Nagy Daniel wrote:
> Is there a methodfor searching in colums just like grep does in rows, but i
> don't know how many colums I will have, so: awk is not good, beacuse awk
> {print $1$2$3} it's not a good soultion:S i have too many colums

Yes, and its call SQL. If you only want to do one or two searches, you
can use perl, or awk, coreutils, etc., but if getting accurate and
reproducible results is important to you, you will need some serious
computational machinery.

Also, in awk, use {print $1, $2, $3 ;} to keep the space delimiter
between columns. And learn about the built-in variable NF. Its value
is always set to the number of fields (columns) in the current line.

HTH

-- 
Paul E Condon           
pecondon@mesanetworks.net


Reply to: