Hixon
Hixon

Reputation: 89

Awk with two condition

I'm a little confused, how to print lines in unix only if two condition is True. I have a tab delimited file with 12 columns.

1 and 7 column is alphabetical, 6 and 12 is numeric.

I want to print line if $1 = $7 and $6 = $12 only.

I would really appreciate your help!

Upvotes: 1

Views: 1228

Answers (1)

Jotne
Jotne

Reputation: 41456

This awk should do:

awk '$1==$7 && $6==$12' file

Upvotes: 3

Related Questions