On 3/16/2008 10:55 AM, nobody@cares wrote:
> Hi,
> Being a beginner in Linux I hit this problem which I know can be
> solved by scripting. I recovered a bunch of files from a disk crash
> that contains all my emails but they were in 2 mb chunks and in no
> particular demarkation. So i combined them into one huge file.
>
> To break them into smaller messages I need to search for a line say
> "---Next_Part ...blah bla ----
> an take everything between the two lines and create the new text
> file as 00000????.txt. Thats all that need to be done in order for
> me to read these email or resend them to myself. Sorry if I am
> missing the obvious but as I said my knowledge in scripting is very
> limited. Like upto shebang
These emails are urgent otherwise I
> would have spent some time to learn a bit more scripting.
>
> Any is much appreciated.
>
> Regards.
>
> superdu
> =============
> Just a noob
>
> --
> --------------------------------- --- -- -
> Posted with NewsLeecher v3.8 Final
> Web @ http://www.newsleecher.com/?usenet
> ------------------- ----- ---- -- -
>
it sounds like all you need is something like:
awk '/---Next_Part/{outfile="foo" ++cnt ".txt"} { print > outfile }' infile
Ed.