in reply to Sort text string by the date embedded

In a slightly different scenario that might nevertheless prove interesting, I actually put a SQLite database file to very good use.   This is, of course, a no-cost, public domain(!) SQL database engine that stores everything in a single file and that runs on everything.   So you could, for example, whip up a file (using Perl, of course) in which you put the strings as-is in one column and the various “interesting” values that you have parsed out of them into other columns.   And once you have gone to that trouble, the payoff is that you can now just use SELECT..ORDER BY.   And you have just co-opted a whole lot of difficulty out of your application by pushing the whole job onto somebody else.   In fact, you have probably just made “your application” a whole lot smaller and with a whole lot less “messy work” to do.

The only caveat ... and it happens to be a big one ... is that with SQLite you must use Transactions, because if you don’t, SQLite will re-read the data after every write!   (Ugh...)   But this is what it was expressly designed to do, and, if you but keep that little fact in mind, it performs splendidly.   (As in, “faster than a sonofabeech.”)   You’ll probably find yourself using them more and more often, because they are “just like ordinary flat files, but ever-so-much more-so.”