Here is the datafile t2, separated by tab

```
_Ibaseebna1_1 0.79(0.28-2.22) 0.6540
_Ibaseebna1_2 0.88(0.48-1.62) 0.6900
_Ibaseebna1_3 0.78(0.32-1.86) 0.5700
ptrend 0.93(0.72-1.20) 0.5800
_Ibaseebna1_1 1.85(0.60-5.73) 0.2850
_Ibaseebna1_2 1.89(0.57-6.27) 0.2950
_Ibaseebna1_3 3.21(1.00-10.33) 0.0510
ptrend 1.39(1.05-1.85) 0.0200
pinteraction 1.39(0.93-2.10) 0.1120

```

i want to remove the value of second column if the $1==ptrend or ==pinteraction.

The results should be like:

```
_Ibaseebna1_1 0.79(0.28-2.22) 0.6540
_Ibaseebna1_2 0.88(0.48-1.62) 0.6900
_Ibaseebna1_3 0.78(0.32-1.86) 0.5700
ptrend     0.5800
_Ibaseebna1_1 1.85(0.60-5.73) 0.2850
_Ibaseebna1_2 1.89(0.57-6.27) 0.2950
_Ibaseebna1_3 3.21(1.00-10.33) 0.0510
ptrend     0.0200
pinteraction     0.1120 

```

I can do this use the code :

```
awk -F' ' ' {
               if ( $1=="ptrend" ) print $1," "," ",$3;
               else
               if ( $1=="pinteraction" ) print $1," "," ",$3;
               else
               print $0; }' t2.txt > t3.txt

```

But when i try to use the for loop:

```
for i in ptrend pinteraction
do

awk -F' ' -v p=$i '{
                if ( $1==p ) print $1," "," ",$3;
                else
                print $0; }' t2.txt > t3.txt
done

```

which give the results like :

```
_Ibaseebna1_1 0.79(0.28-2.22) 0.6540
_Ibaseebna1_2 0.88(0.48-1.62) 0.6900
_Ibaseebna1_3 0.78(0.32-1.86) 0.5700
ptrend 0.93(0.72-1.20) 0.5800
_Ibaseebna1_1 1.85(0.60-5.73) 0.2850
_Ibaseebna1_2 1.89(0.57-6.27) 0.2950
_Ibaseebna1_3 3.21(1.00-10.33) 0.0510
ptrend 1.39(1.05-1.85) 0.0200
pinteraction     0.1120

```

Anything wrong with the loop?