Hi,
I'm trying to build a relationship within an associate array but I'm just not getting there.
I have a flat file which contains data in the following stucture (see below).
Now I want to build a hash and then display the relationship; but only display starting at LEVEL 1 (not LEVEL 0) and sort it A-Z.
Any help would be really appreciated.
I'm trying to build a relationship within an associate array but I'm just not getting there.
I have a flat file which contains data in the following stucture (see below).
Now I want to build a hash and then display the relationship; but only display starting at LEVEL 1 (not LEVEL 0) and sort it A-Z.
Any help would be really appreciated.
Code:
__DATA__
ID|NAME|SUB_ID|LEVEL
16|Internet|12|1
20|Software|12|1
24|Microsoft|20|2
28|Oracle|20|2
32|Google|16|2
36|Yahoo|16|2
40|Amazon|16|2
12|IT| |0
44|Finance| |0
48|Goldman|44|1
56|FirstBank|48|3
52|Credit Suisse|44|1
Code:
- Finance (44)
- Credit Suisse (52)
- Goldman (48)
- FirstBank (56)
- Internet (16)
- Amazon (40)
- Google (32)
- Yahoo (36)
- Software (20)
- Microsoft (24)
- Oracle (28)