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] ++ 'filein 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
Post a Comment