Python for Network Engineers

Using Linux Join Command

By George El. • November 2018 • Reading time: 2 minutes

In this post I demontrate the linux join command $ cat 5.txt 1;orange1 2;orange2 3;orange3 4;orange4 5;orange5 6;orange6 7;orange7 8;orange8 9;orange9 10;orange10 $ cat 6.txt 1;apple1 2;apple2 3;apple3 4;apple4 5;apple5 6;apple6 7;apple7 8;apple8 9;apple9 10;apple10 $ join -t ';' -j 1 -o 1.1,1.2,2.1,2.2 5.txt 6.txt 1;orange1;1;apple1 2;orange2;2;apple2 3;orange3;3;apple3 4;orange4;4;apple4 5;orange5;5;apple5 6;orange6;6;apple6 7;orange7;7;apple7 8;orange8;8;apple8 9;orange9;9;apple9 10;orange10;10;apple10 deleted lines 4 and 5 $ cat 6.