procmail
[Top] [All Lists]

Re: Extract last email from an email file (mbox format)

2016-05-25 14:40:23
On Wed, May 25, 2016 at 8:24 AM, Julian H. Stacey <jhs(_at_)berklix(_dot_)com> 
wrote:
Hi, Reference:
From:         "Ruud H.G. van Tol" <rvtol(_at_)isolution(_dot_)nl>
Date:         Wed, 25 May 2016 09:38:44 +0200

"Ruud H.G. van Tol" wrote:

On 2016-05-25 08:12, Xu Wang wrote:

Hi how can I efficiently extract the last email in a huge mbox email file?

If you need this more than once, I would switch to maildir first.

It was Xu's word "efficiently" that put me off replying earlier:
- efficient in reducing cpu processor time ? Or run time ?
- efficient in minimising transient max disc used ? Or
- efficient in human time ?
   not searching new tools or reading manuals if for a one off job
   & a solution already known, even if cludgy ?

I'd cludge it with my
        http://berklix.com/~jhs/src/bsd/jhs/bin/public/mailsplit/
& if the mbox was truly monstrous & I was about to run out of space, either:
- first dd toward the end of mega mbox.
- or periodically delete numerous output files, either:
  - by suspending job
  - or using another xterm in same dir.

There'll be other more efficient solutions  ;-)

Good questions. I did not clearly define. I apologize for lacking of
clarity. I really used the word efficient just to mean "I hope it
takes not longer than one second considering I have a huge (1GB) mbox
file."

Kind regards,

Xu
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>