Want to show data in tabel format

Hello ,
I need help to show data in table format

i have 2 files A and B

A files contains 2 coulmns

$1 $2
Test 34
Test1 35
Test4 78
Test6 89

B file contains 2 coulmns
$3 $4
Test 65
Test4 67
Test6 98

The coulmn $1 of A file is equal to $3 of B file . sometimes enteries are missing in the file so i have to first match coulmn $1 and $3 and show enteries like this .

I want to show data in tabel format like this
$1 $2 $4
Test 34 65
Test1 35
Test4 78 67
Test6 89 98

Waiting to hear from your end
Please reply
regards
dips

$ cat f1
Test 34
Test1 35
Test4 78
Test6 89
$ cat f2
x x Test 65
x x Test4 67
x x Test6 98
$ join  -a 1 -j1 1 -j2 3 -o 1.1,1.2,2.4 f1 f2
Test 34 65
Test1 35 
Test4 78 67
Test6 89 98

Cheers

i want to use nawk comand for showing into table format . i will redirect to other file and which will be run in shell script

nawk -f a.awk fileA fileB > output.txt

pls help me

sorry ... i have 3 column in each file ...
pls read this ....

File A

$1 $2 $3

File B
$4 $5 $6

where $1,$2 of A file is same as $4 $5 of B file

i need output
$1 $2 $3 $6
Test ver10 78 55
Test1 ver5 89 77
Test4 ver6 88
Test ver8 77 66
pls do help

wasn't an extremely similar question asked and answered here?

awk 'FNR == NR {a[$1]=$1 $2;b[$1]=$0;next} {print b[$1], $3}' file1 file2

awk 'FNR == NR {a[$1]=$1 $2;b[$1]=$0;next} $1 in a {print b[$1], $3}' file1 file2

Thanks . it is working but i have one problem

sometimes $1 $2 doesnt match with $4 $5
i want to print those rows also in table format .

can i do that
it may happen some test cases doesnt run on that day
so i want to print blank on that

i am printing format like this
Vers Host Fails date Fails date2
10 Test1 30 24
10 Test2 34 67
11 Test1 65
11 Test2 65

Please help me

Put this code in a shell script
For eg. test_script.sh

file1=$1
file2=$2

while read a b c
do
v1=$a$b
lp="$a $b $c"
while read x y z
do
v2=$x$y
if [ $v1 = $v2 ]
then
lp="$lp $z"

fi

done < $file2
echo $lp

done < $file1

Then run the shell script
For eg. test_script.sh yourfile1 yourfile2

rajeeb_d,
you've missed the point:

FNR==NR { arr[$1 OFS $2]=$3; next }
{
   idx=$1 OFS $2
   printf("%s\n", (idx in arr) ? idx OFS arr[idx] OFS $3 : $0)
}

how come we have such a similar problem ? :confused: