Just to be on the safe side I use: grep -c ^"From " <listname>.mbox
To separate them by Month use something like: grep ^"From " <listname>.mbox |grep -c " Mar " The months are: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec. Good Luck Jon Carnes On Wed, 2002-09-18 at 19:30, Moz wrote: > 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/ ------------------------------------------------------ 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/
