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

krishna Permalink
June 04, 2013, 02:32


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

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

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

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