Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!tellab5!vpnet!dattier From: dattier@vpnet.chi.il.us (David W. Tamkin) Newsgroups: comp.unix.questions Subject: Re: Sorting mail files chronologically on Unix Message-ID: <1991May02.002903.27854@vpnet.chi.il.us> Date: 2 May 91 00:29:03 GMT References: <26667@adm.brl.mil> <1991Apr29.204812.3476@mrspoc.Transact.COM> Organization: VPnet Public Access Unix, Villa Park, Illinois 60181-2206 Lines: 35 steven@Transact.COM wrote in <1991Apr29.204812.3476@mrspoc.Transact.COM>: | Leisner.henr801c@xerox.com writes: | >How do I sort a mailfile chronologically on Unix? I looked in the | >documentation for Mail (the man pages) and saw nothing about sorting. | >Figured this is useful and someone already did this... | The way that Elm allows you to do this is in a couple of steps: | 1. Sort the "table of contents" in whatever order you want it | 2. Tag all the messages | 3. Save all tagged messages to an alternate file | 4. Replace the original mail folder with the alternate | Note that you still | need to create an intermediate, temporary file to write the sorted | messages to before overwriting the original folder. No, you don't have to create an intermediate mail folder. You can use Elm to sort by any key (and forward or reverse) as you wish, tag all messages in the folder, and save [which will work on all tagged messages if any are tagged] to the very same folder. Elm will append copies of them in the current display order to the end of the file and mark the originals for deletion. Then resynchronize with '$' and the originals are removed, leaving the copies in the desired order. This method works with both Elm 2.2 and Elm 2.3. David Tamkin PO Box 7002 Des Plaines IL 60018-7002 dattier@vpnet.chi.il.us GEnie:D.W.TAMKIN CIS:73720,1570 MCIMail:426-1818 708 518 6769 312 693 0591 "Parker Lewis Can't Lose" mailing list: flamingo-request@esd.sgi.com (relay) flamingo-request@ddsw1.mcs.com (digest)