Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Get random unique lines from file

by radnorr (Initiate)
on Aug 17, 2012 at 20:50 UTC ( [id://988096]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/user/bin/perl -w                                                   
    +                                                        
    # Use your own path                                                   
    +                                                        
    ...
        my $sample = splice @file, $rand, 1; # Cut out the $rand-th line, 
    +offset 1 means just one line                            
        print OUT $sample;
    } # end of for loop
    
  2. or download this
    CTTTTCTTCGGACTACTTACAAGGTGTTGCATGGTCGTC
    >FW4WBAJ01DVAX5.ICM_PML_Bv6.PML_43_2003_06_09
    ...
    TGGTGCCTTCGGGAATCTAGTGACAGGTGATGCATGGCTGTCG
    CACACCAACGCGAAAAACCTTACCAACACTTGACATGTTCGTCGCGACTCTAAGAGATTA
    TTCGGTTCGGCCGGACGAAACACAGGTGTTGCATGGCTGTC
    
  3. or download this
    FW4WBAJ01DVAX5.ICM_PML_Bv6.PML_43_2003_06_09
    FMS0R7002J2YH1.ICM_CAM_Bv6.CAM_0011_2000_03_26
    E6SXMJY02I00IR.ICM_BMO_Bv6.BMO_0005_2007_09_22
    
  4. or download this
    >FRZPY5Q02F00L9.ICM_AWP_Bv6.AWP_0001_2007_08_23
    ACTGCCAACGCGCAGAACCTTACCAGGTCCTGACTTCCTGACTATGGTTATTAGAAATAA
    ...
    >FRZPY5Q02F023C.ICM_AWP_Bv6.AWP_0001_2007_08_23
    ACTGCCAACGCGCAGAACCTTACCAACCCTTGACATCCAGAGAATTTTCTAGAGATAGAT
    TTGTGCCTTCGGGAACTCTGTGACAGGTGATGCATGGCTGTC
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://988096]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found