Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: sort timestamps with associated names.

by hdb (Prior)
on Jul 25, 2013 at 13:40 UTC ( #1046341=note: print w/ replies, xml ) Need Help??


in reply to sort timestamps with associated names.

Some hints how I would solve this:

  1. Your date format yyyy-mm-dd hh:mm:ss is already suitable for lexographical sorting, no need to change the format.
  2. The date is the last 19 characters of each line, so it can be extracted easily using either a regex or substr.
  3. If you read line by line, don't forget to chomp;
  4. The Schwartzian Transform is one way to approach this. Read here: Understanding the Schwartzian transform.




Comment on Re: sort timestamps with associated names.
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046341]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2015-07-04 14:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls