Path: utzoo!attcan!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!CVL.UMD.EDU!sharat From: sharat@CVL.UMD.EDU Newsgroups: comp.mail.mh Subject: Re: Sorting messages by Date and Subject? Message-ID: <8808070534.AA02696@cvl.umd.edu> Date: 7 Aug 88 05:34:10 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 49 Recently Jeff posted the question > Has anyone written a script to sort messages by Date and Subject? > Sortm(1) appears to only handle date sorts, which would be the first > thing to do. However, after that, I'd like something to go thru and > resort the messages based on their subjects (e.g. "X", "Re: X", ...) > and still maintain the chronological order for each new subject. and subsequently answered the question by providing a `newer' sortm. I really wanted something like that but the problem with the newer version is that it cant distinguish subject-headers which are the same but from unrelated people. Specifically let Nancy sent me a msg on 1-1-86 titled Hi (and I reply); If a year later Bob sends me a msg with the same title "Hi", the newer `sortm' puts Bob's message after Nancy's but before several messages in 1986. One would also like a `modified lexicographic' behavior. What I am thinking of is that if the subject heading is the same, and within a window of dates, sortm should do the `Jeff' sort. A window of dates could be something like 10 days, a normal period within which people would have sent replies. In my example Bob's new message falls outside the window and thus will not be considered in the `subject' sorting. This will also allow multiple messages to be `sorted' (ie X, Re:X, Re:X, Re:X posted by several people on a mailing list). Another option would be to sort by subject only if the sender is the same (loses above advantage). Thus formally, messages are sorted by subject and dates within blocks. Blocks are sorted strictly on date. (X and Re:x count as the same subject). Block size is dependent on user. Makes sense? Suggestions? Comments? Do I have a kludge to get this behaviour? (I could of course do a sortm without the subject and the sortm with the subject flag on specific messages; something on the lines of using pick on the dates and then sortm on those messages --- but it gets a trifle hairy; i.e. I don't know how to do that!) ---------------------------------------------------- Electronic: sharat@cvl.umd.edu Arpanet/Domain ...!uunet!mimsy!sharat Uucp