0

I am using awk to check if my data has values of 32th column is greater than 4000 and value of 60th column is less than 10. I am using below command, but it is not working, nor it is showing any error:

awk -F, '$32 > 4000' && '$60 < 10' *

I have , as separator and I am checking it in all the files in a folder.

2
  • 1
    Do you mean row or column? Because you appear to try to check columns. Commented Feb 24, 2015 at 9:37
  • My Mistake. Its column. Commented Feb 24, 2015 at 9:48

2 Answers 2

3

awk evaluates conditions within ' ' and you have two blocks of them, && being outside. So you have to put all this syntax within ' ':

awk -F, '$32 > 4000 && $60 < 10' *

Instead of:

awk -F, '$32 > 4000' && '$60 < 10' *
                   ^    ^
Sign up to request clarification or add additional context in comments.

Comments

1

You could just combine multiple condition within one quote and use it like:

awk -F, '$32 > 4000 && $60 < 10' *

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.