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

Re: splitting mbox files



On Sun, 16 Nov 2003 12:44:02 +0000 (GMT)
Rus Foster <rghf@fsck.me.uk> wrote:

> Hi,
>  Is there a program on debian that would let me split an mbox file
>  into a
> series of single files each containing an email? I've looked and found
> mboxgrep but not sure if there is something else that would be better
>

pigeon posted this script just yesterday.

-------------------------------------------------
 #!/bin/bash
 IFS=$'\n'
 i=0
 BASENAME="split.mbox"
 while read x; do
     echo "$x" | grep '^From ' && i=$(( i + 1 ))
     echo "$x" >> $BASENAME.$i
 done
 
-------------------------------------------------



Reply to: