The_Rev has asked for the wisdom of the Perl Monks concerning the following question:
I need an algorithm that will somehow parse my data sample below. and keep track of the unique hex numbers as well as a consolidated list of int values associated with each hex number
I've tried several things such as pushing only the unique elements onto an array, but I was unable to keep track of the unique int values for each unique hex number#!/perl/bin/perl.exe -w use strict; while (<DATA>) { Dynamic SortRoutine here } __DATA__ 0x130005d 1.253.54.1 11 0x130009c 1.253.54.2 12 0x130005d 1.253.54.1 14 0x130005d 1.253.54.1 11 0x130005d 1.253.54.1 10 0x130009c 1.253.54.2 12 0x130009c 1.253.54.2 14
The desired output would be an array for each unique hex number with elements of unique int values
0x130009c = 12, 14 0x130005d = 10, 11
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Algorithm needed
by elusion (Curate) on Dec 05, 2002 at 23:14 UTC | |
by merlyn (Sage) on Dec 05, 2002 at 23:26 UTC | |
by sauoq (Abbot) on Dec 05, 2002 at 23:36 UTC | |
by merlyn (Sage) on Dec 06, 2002 at 00:28 UTC | |
by sauoq (Abbot) on Dec 11, 2002 at 20:06 UTC | |
by The_Rev (Acolyte) on Dec 05, 2002 at 23:26 UTC | |
|
Re: Algorithm needed
by The_Rev (Acolyte) on Dec 05, 2002 at 23:50 UTC | |
by LTjake (Prior) on Dec 06, 2002 at 00:57 UTC |