Hello,
I have two files:
file1
----
Src
BdU
BoH
BFL
BFR
BdW
BLL
BLR
Bdr
file2
---
Src Lvr
BdU 1.906e-16
BdW 4.199e-16
Bdr 2.869e-16
BLL 1.975e-16
BLR 2.343e-16
BoH 2.625e-15
BFL 3.890e-16
BFR 4.756e-16
BoL 3.091e-16
BoR 3.711e-16
Brn 2.224e-16
Car 1.542e-12
Col 1.034e-12
if $1 from file1 == $1 from file2 ==> print $1" "$2 from file2...
I am trying this code:
awk 'FNR==NR {t1=$1; next}
{if (t1=$1) print ($1" "$2)}' file1 file2
but it prints all the values in file2!!!!...
can someone help me please?
I have two files:
file1
----
Src
BdU
BoH
BFL
BFR
BdW
BLL
BLR
Bdr
file2
---
Src Lvr
BdU 1.906e-16
BdW 4.199e-16
Bdr 2.869e-16
BLL 1.975e-16
BLR 2.343e-16
BoH 2.625e-15
BFL 3.890e-16
BFR 4.756e-16
BoL 3.091e-16
BoR 3.711e-16
Brn 2.224e-16
Car 1.542e-12
Col 1.034e-12
if $1 from file1 == $1 from file2 ==> print $1" "$2 from file2...
I am trying this code:
awk 'FNR==NR {t1=$1; next}
{if (t1=$1) print ($1" "$2)}' file1 file2
but it prints all the values in file2!!!!...
can someone help me please?