OT: combining mbox files

Dhawal Doshy dhawal at NETMAGICSOLUTIONS.COM
Thu Feb 3 14:55:47 GMT 2005


    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

Rodney Green wrote:
> Hello,
>
> I would like to combine quarantined mail files, which are in mbox
> format, to a single file. When I run 'cat * >> newfile' the files are
> combined, but there is no whitespace between each message. I need there
> to be whitespace between each message; whatever is normally required for
> an mbox file containg multiples message. Can anyone offer advise please?
>
> Thanks,
> Rod
>

Create a list of all you required files, typically 'ls > list_of_files'
if they are all in one place OR use the find command to do it.

Next do this on the bash (or whatever shell you use) prompt..

for i in `cat list_of_files` # note these are backticks and not quotes
do
cat $i >> consolidated_file
echo "" >> consolidated_file
done

hope it works.

- dhawal

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!




More information about the MailScanner mailing list