Sorting mail files chronologically on Unix

David W. Tamkin dattier at vpnet.chi.il.us
Thu May 2 10:29:03 AEST 1991


steven at Transact.COM wrote in <1991Apr29.204812.3476 at mrspoc.Transact.COM>:

| Leisner.henr801c at 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 at 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 at esd.sgi.com (relay)  flamingo-request at ddsw1.mcs.com (digest)



More information about the Comp.unix.questions mailing list