Rearrange data from 2 files

Dear All,

I have the below files

A file contains

1473
1649
1670
1758
1767
1784

B file contains

1242
1246
1264
1268
1284
1340

I want the output like
First Entry of A file|first entry in B file
First Entry of A file|second entry in B file
First Entry of A file|third entry in B file
.
.
.
Second Entry in A file|First entry in B file
Second Entry in A file|second entry in B file
.
.
till the end...

How can I do this ???
please help

try this

while read linea ; do
while read lineb ; do
echo "$linea|$lineb"
done<fileb
done<filea
(paste -d'|' A B ; paste -d'|' B A ) 

Thanks a lot, first suggestion is working perfectly, I will try the second one...
Thanks again :slight_smile: :slight_smile: