On Thu, 2012-03-08 at 09:45 -0300, Alessandro Antonello wrote:
> Hi, all.
> 
> I have a file with the following output:
> 
> pass1 key: 9534 1CFF A92D 76B9 B52C 79E5 1D10 85E5
> pass2 key: 6C66 D635 3922 1D99 6FCE 8366 7992 C3DE
> passN key: F906 930C 2FD3 6B4B 7A2C 1AF5 C314 D62C
> 
> There are several of that 3 lines. I could ':sort' the file to find duplicated
> lines but, what I really need to know is if there are binary data of 'pass1
> key' equal to 'pass2 key' or 'passN key'. I have 3 files with more than 8000
> lines each. So, visually do this is tedious and error prone. I need a little
> help, please.
> 
> Alessandro
> 

$ cp -p passfile passfile.orig
$ cat passfile # 3 repititions of your example lines above
pass1 key: 9534 1CFF A92D 76B9 B52C 79E5 1D10 85E5
pass2 key: 6C66 D635 3922 1D99 6FCE 8366 7992 C3DE
pass3 key: F906 930C 2FD3 6B4B 7A2C 1AF5 C314 D62C
pass4 key: 9534 1CFF A92D 76B9 B52C 79E5 1D10 85E5
pass5 key: 6C66 D635 3922 1D99 6FCE 8366 7992 C3DE
pass6 key: F906 930C 2FD3 6B4B 7A2C 1AF5 C314 D62C
pass7 key: 9534 1CFF A92D 76B9 B52C 79E5 1D10 85E5
pass8 key: 6C66 D635 3922 1D99 6FCE 8366 7992 C3DE
pass9 key: F906 930C 2FD3 6B4B 7A2C 1AF5 C314 D62C
rthompso@raker2>~
$ sort -k2 -t: -b passfile  | uniq -f2
pass2 key: 6C66 D635 3922 1D99 6FCE 8366 7992 C3DE
pass1 key: 9534 1CFF A92D 76B9 B52C 79E5 1D10 85E5
pass3 key: F906 930C 2FD3 6B4B 7A2C 1AF5 C314 D62C
[08:29:35] rthompso@raker2>~   
$ sort -k2 -t: -b passfile  | uniq -f2 > passfile

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to