Salve,
Sono un nuovo studente di aderire comando. Alcuni risultato che mi confuse.
Vi preghiamo gentilmente di aiutarmi.
ingresso:
Codice:
file1:
LEO oracle engineer 210375
P.Jones Office Runner ID897
L.Clip Personl Chief ID982
S.Round UNIX admin ID6
file2:
Dept2C ID897 6 years
Dept5Z ID982 1 year
Dept3S ID6 2 years
GEDA 210375 1 year
Che cosa vogliono i esattamente è:
Codice:
ID897 P.Jones Office Runner Dept2C 6 years
ID982 L.Clip Personl Chief Dept5Z 1 year
ID6 S.Round UNIX admin Dept3S 2 years
210375 LEO oracle engineer GEDA 1 year
Seguire è il codice e il risultato secondo il mio esempio. Qualcuno potrebbe spiegare il motivo per cui il risultato non è corretto. Sembra soaris mia posso solo i primi due linee di produzione (dal momento che, se i dividere il file di input a quattro gruppi, ogni gruppo e contiene una sola riga, funziona bene.)
Grazie in anticipo!
Codice:
code1: join -j1 4 -j2 2 file1 file2
result1:
ID897 P.Jones Office Runner Dept2C 6 years
ID982 L.Clip Personl Chief Dept5Z 1 year
code2:join -a1 -j1 4 -j2 2 file1 file2
reuslt2:
210375 LEO oracle engineer
ID897 P.Jones Office Runner Dept2C 6 years
ID982 L.Clip Personl Chief Dept5Z 1 year
code3:
join -a2 -j1 4 -j2 2 file1 file2
reustl3:
ID897 P.Jones Office Runner Dept2C 6 years
ID982 L.Clip Personl Chief Dept5Z 1 year
ID6 Dept3S 2 years
210375 GEDA 1 year