You're viewing a comment by krishna and its responses.

krishna Permalink
June 04, 2013, 02:32

hi,

I have a file with 20 columns and the 20th column varies from 1 to 6000. Few of the 20th column can also have the same number. I want to have the rows where 20th column |wc is greater than 3 (for the same value)
rows= 8560

for (( n=1; n<8560; n++ )); awk -v val=$n ' $20==val {cnt++} END if ( cnt>3 ) print $0' temp.txt 

there was some syntax problem. Where it was wrong

Comment Responses

July 05, 2013, 18:03

What shell are you using? The syntax for a for loop is:

for (( exp1; exp2; exp3 )); do
  COMMANDS;
done

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "browser": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.