i'm writing a script to organize images in an online gallery, and i can't seem to work my mind around how to sort these images by date. i've got a text file with entries like such:
where FILE is the alphanumeric filename, WIDTH and HEIGHT are numeric dimensions, and TIME is a time string such as you'd get from time().
now, all these entries are in a text file, seperated by newlines like so:
and so on. what i need to do, is rearrange this text file to sort the entries by that time string so that the newer ones are at the beginning. any ideas on the best way to do this?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||