Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: extracting only those keys with uniq values in array list

by tybalt89 (Prior)
on Apr 20, 2021 at 15:45 UTC ( #11131516=note: print w/replies, xml ) Need Help??


in reply to extracting only those keys with uniq values in array list

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11131485 use warnings; @ARGV = 'd.11131485'; # FIXME used for testing my %seen; while( <> ) { my ($r_name, $seq) = (split /\t/)[0, 9]; $seq =~ s/.{20}\K.*//; $seen{"$r_name\t$seq"}++ and print "$r_name\n"; }

Works with the data file I had to fake up because you did not provide a sample data file.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11131516]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2021-05-13 23:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (144 votes). Check out past polls.

    Notices?