awk for selecting columns of different data files

Hello friends,

How can I use awk commands to obtain selective blocks from different data files. For example

file1
a b c
d e f
g h i

file2
1 2 3
4 5 6
7 8 9

output
a b 2 3
d e 5 6
g h 8 9

is it possible ?

thanks

Pls use code tags as advised.
As you do not specify any rule on how to combine the files, I just guessed it should be $1, $2 from file1, and $2, $3 from file2, per line no. Try

$ awk 'NR==FNR {Ar[FNR]=$1FS$2;next} {print Ar[FNR], $2, $3}' file1 file2
a b 2 3
d e 5 6
g h 8 9
1 Like

it works fine thank you RudiC