[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sort and delete duplcate messages

From: Ken Hornstein
Subject: Re: Sort and delete duplcate messages
Date: Sun, 03 May 2020 21:19:34 -0400

>I know that 'sortm -textfield Subject' will sort messages accoring to
>the subject field. Having run that command, is there a way to then
>delete the first duplicate of each message in the list such that if 1
>and 2 are duplicates and 6 and 7 are duplicates you would delete messages
>2 and 7 leaving 1 and 6?

I want to say you could do something with piping the output of scan
into "uniq -d -f <num>".  Might require a custom scan format, but that
seems relatively simple.

Hm, a quick test:

% scan -format '%(msg) %{subject}' | uniq -d -f 1

suggests that it prints the first one, not later ones, so that isn't
exactly what you want.  Might be a good starting point, though?  You could
probably do something with uniq -c and pipe that to an awk script that
did what you wanted.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]