Search Results

Search: Posts Made By: seiksoon
1,790
Posted By pamu
above logic can be reduced to..... awk...
above logic can be reduced to.....

awk 'NR==1 {print; next} {
if (($2 == $4 || $2 == $5) && ($3 == $4 || $3 == $5)) {
$(NF+1)=2}
else if (($2 == $4 || $2 == $5) || ($3 == $4 ||...
1,790
Posted By pamu
$ awk...
$ awk '{for(i=2;i<=NF;i++){if(A[$i,NR]++){n++}};$(NF+1)=n;n=0}1' file

1 201 3101 3101 201 2
2 3101 201 202 3101 1
3 3101 201 201 3102 1
4 3101 201 3202 202 0

OR lit bit more robust..

$...
1,474
Posted By balajesuri
awk '$7>=0.3{print $1}' inputfile
awk '$7>=0.3{print $1}' inputfile
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 04:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy