Removing Unique and Reverse pairs using Awk or Perl -


Below is my sample file (column 1 and column separated by 2 tabs)

 < code> P-49418 "\ t" O43426 P49418 "\ t" O43426 O43426 "\ t" P 49418 ......   

Only one for the three pairs shown above Representative should

  P49418 "\ t" O43426   

Similar attempts need to be done on the rest files awk or How can Pearl be used?

This should work with awk :

 < code> awk -F '\ t' '! a [$ 1, $ 2] ++ & amp; Amp; Use both [$ 2, $ 1] ++ 'file   

in both order form as the key of the array and check the duplicate.

 $ cate file P49418 O43426 P49418 O43426 O43426 P49418 $ awk -F '\ t' '! One [$ 1, $ 2] ++ & amp; Amp; ! A [$ 2, $ 1] ++ 'file P49418 O43426    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -