Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^4: Remove duplicate entries

by kcott (Canon)
on Nov 17, 2010 at 17:11 UTC ( #872020=note: print w/ replies, xml ) Need Help??

in reply to Re^3: Remove duplicate entries
in thread Remove duplicate entries

Your inner loop is iterating based on the number of elements in @gp_name but you are increasing the length of that array with push @gp_name, $key;.

I suggested a lookup table and envisaged something like:

my %group_table = ( 'On' => 'One', 'Two' => 'Two', 'Twel' => 'Twelve', 'Twen' => 'Twenty', ... );

So, if "Group " is common to all keys, strip that off. Then take increasingly larger substrings from what's left until you get a match. Include some limit so when you've tried X characters and still found no match, give up and put that item in a separate "bucket" for manual intervention.

-- Ken

Comment on Re^4: Remove duplicate entries
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2015-12-01 21:03 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (27 votes), past polls