DieSucker Posted June 27, 2006 Share Posted June 27, 2006 ok so say that I got a txt file with a bunch of lines like the one below[code]Record[0]=CTF-BT-Athletic1000 1955 trs|McN 1150150175CTF-BT-Lego 1908 Hazen_Blazen 1150285451CTF-BT-w00tw00t_fix 1964 jumper 1150200327CTF-BT-andACTION 1989 trs|DieSucker 1150749074[/code]and then I am spliting each line first at the "=" so then i have just [code]CTF-BT-Athletic1000 1955 trs|McN 1150150175CTF-BT-Lego 1908 Hazen_Blazen 1150285451CTF-BT-w00tw00t_fix 1964 jumper 1150200327CTF-BT-andACTION 1989 trs|DieSucker 1150749074[/code]then spliting it at "\t" so basically i end up with[code]CTF-BT-Athletic10001955trs|MCN1150150175CTF-BT-Lego1908Hazen_Blazen1150285451[/code]so is there anyway to organize all his by unixdate code? Quote Link to comment Share on other sites More sharing options...
hvle Posted June 27, 2006 Share Posted June 27, 2006 what do you mean by organize all this by unixdate code? Quote Link to comment Share on other sites More sharing options...
DieSucker Posted June 28, 2006 Author Share Posted June 28, 2006 [!--quoteo(post=388464:date=Jun 27 2006, 06:58 AM:name=hvle)--][div class=\'quotetop\']QUOTE(hvle @ Jun 27 2006, 06:58 AM) [snapback]388464[/snapback][/div][div class=\'quotemain\'][!--quotec--]what do you mean by organize all this by unixdate code?[/quote]well organize by date, each unixdate code has a date associated with it ie 6/26/2006(date(mdY))so is there anyway to get the most recent dates on top of the list and later ones towards the bottom Quote Link to comment Share on other sites More sharing options...
hvle Posted June 29, 2006 Share Posted June 29, 2006 ok,first, you need to read them all into an array. You know that a 4 lines will be 1 row, so it'll be easy problem.then sort the array with ksort, specify the key you wanted to sort. If you specify the key with timestamp, it'll sort by timestamp, and so on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.