Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: sort email ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 12 Topic 2169 of 2312
Post > Topic >>

Re: sort email by date

by Ed Morton <morton@[EMAIL PROTECTED] > Feb 25, 2008 at 08:28 AM

On 2/24/2008 9:47 PM, droid wrote:
> I have "received" emails from the early nineties to present.  These
> are concatenated together in two huge files.
>
> My problem is that segments of one file need to be inserted into the
> other file.  Also, there would be many dupes.
>
> I was hoping to find a utility that could do the sorting after joining
> them with 'cat', then use Thunderbird to remove
> the dupes.

How do you identify a dupe - by timestamp or by contents?

> But from the replies here, it appears this is more complicated than I
> supposed.

I misunderstood your original question. I think what you might want to do
is
split your 2 huge files into 1 file per email, named based on the
date+time of
the email plus some unique incrementing key. Then a simple "ls" will
"sort" them
and you can use "diff" as you create them (or afterwards) to decide if a
given
email with the same date/time as an existing one is actually a dup (in
which
case don't create the file) or a different email with the same timestamp
(in
which case increment the uniqueness key). Then you can "cat" them all
together
if you like and they'll automatically be sorted in the resulting file.

You may want to use procmail and formail to help normalise the emails for
selecting the timestamp and creating the unique files.

None of that necessarily requires awk, though, so further discussion of
that
solution would be OT for this NG. Follow up at comp.unix.shell if you want
to
pursue it.

	Ed.
 




 12 Posts in Topic:
sort email by date
droid <jshowalter@[EMA  2008-02-24 11:20:20 
Re: sort email by date
Ed Morton <morton@[EMA  2008-02-24 15:25:27 
Re: sort email by date
gazelle@[EMAIL PROTECTED]  2008-02-25 00:56:26 
Re: sort email by date
Ted Davis <tdavis@[EMA  2008-02-24 20:16:22 
Re: sort email by date
droid <jshowalter@[EMA  2008-02-24 19:47:46 
Re: sort email by date
Ted Davis <tdavis@[EMA  2008-02-25 08:21:37 
Re: sort email by date correction
Ted Davis <tdavis@[EMA  2008-02-25 10:49:08 
Re: sort email by date
Edward Morton <morton@  2008-02-25 08:28:01 
Re: sort email by date
Ed Morton <morton@[EMA  2008-02-25 08:28:59 
Re: sort email by date correction
droid <jshowalter@[EMA  2008-02-25 09:19:54 
Re: sort email by date
spcecdt@[EMAIL PROTECTED]  2008-02-25 22:08:12 
Re: sort email by date
William James <w_a_x_m  2008-02-25 16:12:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 20 17:23:36 CDT 2008.