lundi 16 juillet 2018

Compare columns from different files

I have 2 files (File 1 & File 2) I need to compare the columns Total only. And high light the difference. One I worked with but shows all the columns is.

vimdiff 1.txt \ 2.txt -c TOhtml -c 'w! diff2.html' -c 'qa!'

I tried with and no luck. diff -y <( awk '{print $1,$3}' file1) <( awk '{print $1,$3}' file2 ) diff <(cut -f1,3 file1) <(cut -f1,3 file2)

File 1 Total Reg Oper Unreg Offline Wideband initRC initD initIO initO
C1/0/0/UB 126 126 126 0 0 126 0 0 0
C1/0/0/U0 79 75 75 4 3 0 0 0 0
C1/0/0/U1 65 60 60 5 4 0 0 0 0

File 2

          Total Reg   Oper  Unreg Offline Wideband initRC initD initIO initO   

C1/0/0/UB 97 97 97 0 0 97 0 0 0
C1/0/0/U0 65 65 65 0 0 0 0 0 0
C1/0/0/U1 18 17 17 1 1 0 0 0 0




Aucun commentaire:

Enregistrer un commentaire