sorting based on a field

view full story

http://www.unix.com – the below is sorted as it is. the fields that i'm interested in are the 4th and 5th field. i want to sort the based on the 4th field. my past attempt to do this was to do something like this: Code: awk '{print $4}'| awk '{print $1":"$2}' datafile | sort | uniq however, if i do that, i lose track of if the times are PM or AM. So my question, how do i sort this based on the 4th field and still know which time belongs to what time of day (pm or am). here is the datafile (mar 31 can of course be substituted with the current date) Code: <Mar 31, 2012 8:43:40 AM UTC&gt (HowTos)