Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Oddly growing array

by sk (Curate)
on Oct 05, 2005 at 16:52 UTC ( #497674=note: print w/replies, xml ) Need Help??


in reply to Oddly growing array

This script looks at one .TAB file, compares each line's second tab stop text (probably very inefficiently) to all the other line's second tab stop text. I'm looking for duplicates.

haven't had a chance to read the code but wouldn't something like this do what you want?

Untested

#!/usr/bin/perl use strict; use warnings; my %dups; while (<DATA>) { my $col = (split /\t/)[1]; # get the second col $dups{$col}++; # put the text into a hash and increment counter. } print +($_ , " : ", $dups{$_},$/) for (keys %dups); # print the counts

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://497674]
help
Chatterbox?
[LanX]: *his
[holli]: And this guy was also Anti-Vaxx and I just snapped. I shoed him all over the yard
[james28909]: biting between the legs? now thats my kind of religion.
[holli]: and back into the building, saw him later peeking out of the window looking scared. It was hilarious.
[LanX]: Let's get physical...
[james28909]: wish i could stay and chat. i have an unsuspecting client to give an estimate to. muhhahaha

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (16)
As of 2017-12-13 18:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (373 votes). Check out past polls.

    Notices?