Danny wrote:

> I have a .mbox file of 890Mb in size. I want to know how many
>messages are in it and how much messages per month.  Can someone help
>me to write a shell script?

Each message starts with a line like "From [EMAIL PROTECTED]",
so you can just count those. Divide by months in file to get messages/
month.

grep -c "From <list>" <file>

For the mailman archive, this works:

grep -c -i "From [EMAIL PROTECTED]" mailman-users.mbox

After some thrashing, the number is:

C:\docs>grep -c "From mailman-users" mailman-users.mbox
File mailman-users.mbox:
2721 lines match

The space is important: lots of header lines have "From: ..."

Moz


------------------------------------------------------
Mailman-Users mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/

Reply via email to