I think my brain disappeared temporarily.
I'm trying to figure out the best way to to organize my data so that I can produce output in a more flexible way.
For example, let's say that I have 3 pieces of data: Employee Number, Form Number, Date and I want to be able to produce a summary based on either the Employee Number or Form Number. E.g., For employee 1, list all the form numbers and when they were signed and, likewise, list the employees that have signed a particular form with date signed.
I know that I could stick everything in an sequential array and just offset by three until the third offset counter equals the size of the array but looking at the code is making me ill. Of course, this assumes that every set of data has exactly 3 elements, which is the case here (seems like a poor coding practice to me though).
Unfortunately, I've never really dealt with complex data structures so I'm a little at lost as to how to structure this data. A hash of arrays, hash of hashes, etc.
If that doesn't make sense here's some test data:
Employee Form Date 10001 10 20090101 10002 10 20080515 10003 10 20090323 10001 20 20090412 10002 20 20090711
I'm trying to make the output look something like this:
10001 10 20090101 20 20090412 10002 10 20080515 20 20090711 10003 10 20090323
Or
10 10001 20090101 10002 20090412 10003 20090323 20 10001 20090412 10002 20090711
Hopefully, that makes more sense than my word-based explanation.
Thanks
In reply to Data Structure Question by bohrme
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |