Alright, so I’m supposed to make a script that parses all the chat logs from irc channels, combine the ones that match names, and then sort the chat logs by date.
This is an example chat log:
jul 29 19:20:53 <lol> lolfile3
jul 31 19:20:53 <lol> lolfile3321
aug 1 19:20:53 <lol> lolfile31324
jul 30 19:20:53 <lol> lolfile32
I need to order them by the timestamp (jul 30 19:20:53) however I’ve been trying for hours on end but to no avail.
Here’s the code I already have (this is file merging, file writing and everything. The timestamp is the last thing I need to do!)
I couldn’t figure out how to add code to my question so I link you to pastebin:
http://pastebin.com/2VrSRZZr
Thank you so much if you could help me by posting code. Obviously I don’t expect to be spoonfed but some code would be nice.
I’m not entirely sure what the “” in your example is, so this may not be entirely correct, but it shows how to convert the timestamp strings to comparable objects. Hopefully this gets you on the right track.
EDIT: I ran the code you created in pastebin and the output was