TCS OPA UNIX Solution 15 May

TCS OPA UNIX Solution 15 May

read
awk 'BEGIN{FS=",";choice;count;i}
     { if(NR==1)
       {choice=$3;a[i++]=$3}
       else{
            a[i++]=$3;
            if(choice>$3) {choice=$3;}
            }
    }
    END{ for(j=0;j<i;j++)
        {
           if(a[j]==choice){
             count++;
            }
        }
        {print count}
    }'

Comments

Post a Comment