[Mailman-Users] Amount of messages in a .mbox file

Moz lists at moz.co.nz
Thu Sep 19 01:30:31 CEST 2002


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 mailman-users at python.org",
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 mailman-users at python.org" 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





More information about the Mailman-Users mailing list