Bash : joint 2 fichiers ?

Résolu
mortel -  
 mortel -
Bonjour,

J'ai un fichierA
man01 xxx yyy zzz
man02 xxx yyy zzz
man03 xxx yyy zzz
man04 xxx yyy zzz


Et un fichierB
man01 ggggg kkkkk
man02 yyyy
man02 tttttt jjjjjj
man04 lllllll rrrrrrrr eeeeeee


Comment joindre les 2 fichiers pour obtenir
man01 xxx yyy zzz ggggg kkkkk
man02 xxx yyy zzz yyyy
man02 xxx yyy zzz tttttt jjjjjj
man03 xxx yyy zzz
man04 xxx yyy zzz lllllll rrrrrrrr eeeeeee


Merci

A voir également:

3 réponses

dubcek Messages postés 18789 Date d'inscription   Statut Contributeur Dernière intervention   5 637
 
hello
avec awk
$ awk 'FNR==NR {t[$1]=$0; next}  {x=$1; $1=""; print t[x] $0}'  A B
man01 xxx yyy zzz ggggg kkkkk
man02 xxx yyy zzz yyyy
man02 xxx yyy zzz tttttt jjjjjj
man04 xxx yyy zzz lllllll rrrrrrrr eeeeeee
1
zipe31 Messages postés 36402 Date d'inscription   Statut Contributeur Dernière intervention   6 431
 
Salut,

Voir la commande
join
;-)
0
mortel
 
merci
0