|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: Consolidating biological data into occurance of each biological unit per sample in tableby Cristoforo (Chaplain) |
| on Jan 13, 2013 at 03:49 UTC ( #1013081=note: print w/ replies, xml ) | Need Help?? |
|
This would apply only to the data you provided - an animal name and its color, coded as they are. Update: Upon reflection, several points occured to me. For one thing, this code doesn't deal with any possible additional fields other than 'animal' and 'color'. That could be fixed with some minor changes to the code. And using Text::Table for the presentation is probably the wrong choice given that there may be 100's of animals/colors (as well as more than a dozen or so 'samples', (A to Z??). I think Text::Tables is more suited to smaller datasets that you can see on 1 or 2 pages of output. Two possible solutions I can think of would be to create a comma separated values file with the program output to be read by a spreadsheet program like Excel. Excel allows you to freeze the headers or first column, (animal or color), so you can scroll through the output and still keep the categories in sight. The other possibility would be to load the processed data into a database like SQLite and then query the database for output. The output from the above program is:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||