Hi,
I trying to build hashes of arrays in order to populate a recursive relationship structure based on two flat files. (See expected results at the bottom)
The first flat file contains the "Parents" data and the second flat file contains the "Childs" data. (See below for data)
I'm currently using multiple arrays to populate this structure, so as you may already know this takes alot of time to generate.
So will an hash of arrays be a good solution for this. Any guidance or help would be appreciated.
DATA
Expected output
In bold is GROUP DATA (Parents)
In non-bold is SUB GROUP DATA (Childs)
Thank you in advance
I trying to build hashes of arrays in order to populate a recursive relationship structure based on two flat files. (See expected results at the bottom)
The first flat file contains the "Parents" data and the second flat file contains the "Childs" data. (See below for data)
I'm currently using multiple arrays to populate this structure, so as you may already know this takes alot of time to generate.
So will an hash of arrays be a good solution for this. Any guidance or help would be appreciated.
DATA
Code:
__GROUPDATA__
ID|ABBR|ALTERNATE|ADDRESS|CITY|PARENT_ID|ACTIVE
12|ITT|IIT Alternate|390 Long View|Lisbon|36|1
14|ABG|ABG Alternate|22009 Routa Technica|Citoplo|12|1
16|FFQ|FFQ Alternate|230 River Road|River City|12|1
18|LPP|LPP Alternate|90293 Tera Nosta Mud Road|Mud City|36|1
20|GKQ|GKQ Alternate|232 Portee Road|Potish|16|1
22|TIO|TIO Alternate|454 Looish|Sustone|18|1
24|TRP|TRP Alternate|333 Nesbitt Road|Grey City|18|1
26|REE|REE Alternate|923 Hunty Avenue|Hungstead|18|1
28|TLP|TLP Alternate|730 Lumberg|Houstonish|22|1
30|TAA|TAA Alternate|40222 Laponte|Loomis|22|1
32|TRR|TRR Alternate|2290 Rescto|Ohia|26|1
36|QWE|QWE Alternate|2090 Bolton Road|Redmond| |1
___SUBGROUPDATA__
ID|NAME|JOB|PARENT_ID|ACTIVE
120|Terry Turbo|Stapler Expect|14|1
122|Bobby George|Stapler Expect|20|1
124|Paul Danan|Stapler Expect|20|1
126|Barry Castagnola|Stapler Expect|22|1
128|Jordan Long|Stapler Expect|22|1
130|Norris Windross|Stapler Expect|28|1
132|Adam Saint|Stapler Expect|28|1
134|Adam Peacoc|Stapler Expect|26|1
136|Myfanwy Waring|Stapler Expect|26|1
138|Alexander Newland|Stapler Expect|32|1
Expected output
In bold is GROUP DATA (Parents)
In non-bold is SUB GROUP DATA (Childs)
Code:
[b]- [36] QWE / QWE Alternate (2090 Bolton Road, Redmond)[/b]
[b]- [12] ITT / IIT Alternate (390 Long View, Lisbon)[/b]
[b]- [14] ABG / ABG Alternate (22009 Routa Technica, Citoplo)[/b]
+ [120] Terry Turbo (Stapler Expect)
[b]- [16] FFQ / FFQ Alternate (230 River Road, River City)[/b]
[b]- [20] GKQ /GKQ Alternate (232 Portee Road, Potish)
+ [122] Bobby George (Stapler Expect)
+ [124] Paul Danan (Stapler Expect)
[b]- [18] LPP / LPP Alternate (90293 Tera Nosta Mud Road, Mud City)[/b]
[b]- [22] TIO /TIO Alternate (454 Looish, Sustone)[/b]
+ [126] Barry Castagnola (Stapler Expect)
+ [128] Jordan Long (Stapler Expect)
[b]- [28] TLP / TLP Alternate (730 Lumberg, Houstonish)[/b]
+ [130] Norris Windross (Stapler Expect)
+ [132] Adam Saint (Stapler Expect)
[b]- [30] TAA / TAA Alternate (40222 Laponte, Loomis)[/b]
[b]- [24] TRP / TRP Alternate (333 Nesbitt Road, Grey City)[/b]
[b]- [26] REE / REE Alternate (923 Hunty Avenue, Hungstead)[/b]
+ [134] Adam Peacoc (Stapler Expect)
+ [136] Myfanwy Waring (Stapler Expect)
[b]- [32] TRR / TRR Alternate (2290 Rescto, Ohia)[/b]
+ [138] Alexander Newland (Stapler Expect)
Thank you in advance