Good localtime friends,
Given a large 1000+ line file with the following format (flexible here):
Collection=>168245 ImageCount=>6 Status=>SI Missing=>1,3 Modified=>01/
+18/2012 11:14:30
Collection=>161745 ImageCount=>6 Status=>I Missing=>2,3 Modified=>01/1
+8/2012 11:16:38
Collection=>162451 ImageCount=>6 Status=>SC Missing=> Modified=>01/20/
+2012 11:16:38
Collection=>117481 ImageCount=>8 Status=>C Missing=> Modified=>01/18/2
+011 7:16:38
...
What would be the best way to extract all the information into a hash so that I can can perform sorts based on Collection, Status, and Modified?
Some caveats:
1)Collection would be the db equivalent of an unique id.
2)I cannot use a database or non-core modules.
3)I will dynamically build web pages displaying collection information on a table row based upon a timeframe a user requests, so I will have to play with dates a bit.
4)The creation of the file containing the format about is done in the background, so anything I can do to speed up fetching/sorting specific to file format etc would be worth considering.
Thanks for your advice,
hok
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.