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}
}'
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}
}'
please give solutions with questions
ReplyDelete