Il y a la version *awk* simple et efficace comme d'hab ;-)
soit "/tmp/a" ton fichier A et "/tmp/b" ton fichier B, crée le script
suivant :
*#!/usr/bin/awk -F; -f
BEGIN { while ((getline < "/tmp/b") > 0)
fic2[$1]=$2 }
{ if (fic2[$1])
printf "%s%s%s\n",$1,FS,fic2[$1]
else
print $0
}
*sauvegarde le script sous /tmp/compare.awk ou ailleurs si tu préfères
chmod +x /tmp/compare.awk *qui va bien*
ensuite un petit :
cat /tmp/a | /tmp/compare.awk
et le resultat :
"REFERENCE";"DESCRIPTION"
"348618";"VALEUR 1"
"348618-1";"VALEUR B"
"348618-4";"VALEUR C"
"347683";"VALEUR D"
_______________________________________________
archives :
http://listes.patpro.net/list/sshfr.fr.html
http://listes.patpro.net/mailman/listinfo/script_shell_fr