shaezi has asked for the wisdom of the Perl Monks concerning the following question:
am attempting to remove duplicates from sorted data by keeping the last entry in a set of matching keys. For example consider the following data:
02626216000.00001.00001.00001.00001.00
02626216000.00002.00002.00002.00002.00
02626216000.00005.00000.00005.00005.00
The key is the first 8 bytes of data, followed by data buckets.
If I use the following code:
foreach (@sorted_data) { push(@data_out, $_) unless ($seen{substr($_,0,7)}++); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: removal of dupes using a hash
by Limbic~Region (Chancellor) on May 20, 2004 at 20:50 UTC | |
|
Re: removal of dupes using a hash
by pizza_milkshake (Monk) on May 20, 2004 at 21:09 UTC | |
|
Re: removal of dupes using a hash
by sleepingsquirrel (Chaplain) on May 20, 2004 at 22:45 UTC | |
by sleepingsquirrel (Chaplain) on May 20, 2004 at 23:15 UTC | |
|
Re: removal of dupes using a hash
by johndageek (Hermit) on May 20, 2004 at 21:12 UTC | |
by jarich (Curate) on May 21, 2004 at 01:05 UTC | |
|
Re: removal of dupes using a hash
by deibyz (Hermit) on May 21, 2004 at 13:37 UTC | |
|
Re: removal of dupes using a hash
by sleepingsquirrel (Chaplain) on May 21, 2004 at 16:48 UTC |