I am trying to use awk as some types of element counter as follows, but I got syntax error.
cat file | awk '{if($2>$3)A[$1]++}END{for(index in A){print index, A[index]}}'
Can someone help?
Here is the syntax error:
awk: {if($2>$3)A[$1]++}END{for(index in A){print index, A[index]}}
awk: ^ syntax error
awk: {if($2>$3)A[$1]++}END{for(index in A){print index, A[index]}}
awk: ^ syntax error
awk: {if($2>$3)A[$1]++}END{for(index in A){print index, A[index]}}
awk: ^ syntax error
Thanks you very much!