Inserting 2 columns from a file to another with nawk

Hello all,

I have these 2 files

File1

123 100
456 200
789 300

File2

|1|2|3||4|5||6|
|1|2|3||4|5||6|
|1|2|3||4|5||6|

I need an output like :

 
|1|2|3|123|4|5|100|6|
|1|2|3|456|4|5|200|6|
|1|2|3|789|4|5|300|6|

I am trying this piece of code, but it's not working well.

nawk 'NR == FNR { 
  f1[$1]=$1 ; f1[$2]=$2
  next 
  }
{ 
  print $1 $2 $3 $4 f1[$1] $6 $7 f1[$2] $9
  }' ttt1 ttt2

Could anyone help please ?

Thx in advance,

I don't have nawk to test this, but it should work with nawk too:

cat ttt1 | tr " " "|" | awk -F"|" -vOFS="|" 'NR==FNR{a[NR]=$1;b[NR]=$2;next}{$5=a[FNR];$8=b[FNR]}1' - ttt2

Try this one:

awk -F"|" 'NR==FNR{split($0,v," ");a[NR]=v[1]; b[NR]=v[2]; next}
{$5=a[FNR]; $8=b[FNR]}1' OFS="|" File1 File2

Thx a lot to both.

Regs,