Q:deleting mail headers in multiple files "catted" togather

Q:deleting mail headers in multiple files "catted" togather

Post by James L » Tue, 26 Mar 1996 04:00:00



I just received about 40 emails when properly "cut-up" and "pasted"
togather, will create about 6 postscript files.  Instead of saving
Individual message togather, I just copied the message from /var/mail
directory.  So it`s just a single huge file.

Is there an easier and faster way to do this than manually editing them?

I`m using tcsh.  Thanks

 
 
 

Q:deleting mail headers in multiple files "catted" togather

Post by David and Rachel Weintra » Tue, 26 Mar 1996 04:00:00




> I just received about 40 emails when properly "cut-up" and "pasted"
> togather, will create about 6 postscript files.  Instead of saving
> Individual message togather, I just copied the message from /var/mail
> directory.  So it`s just a single huge file.

> Is there an easier and faster way to do this than manually editing them?

I thought of using sed. I would eliminate all lines that have a ":" in
them or were blank, but it's possible that your PostScript file might have
a ":" in it.

A Perl script would work. You find lines beginning with "From " and remove
all lines upto and including the next blank line. However, it might be
quicker and easier simply mapping a key in "vi" to do this instead of
writing a Perl script. Especially if this is a one shot deal. A possible
map might be:



" at the beginning of the line, delete the paragraph (up to the next blank
line), and finally delete the blank line itself. If you're lucky, you
could map one of your Function Keys to this macro like this:

:map #1 /^From ^Md}dd

This might map F1 to the macro. It works in my hpterm on HP-UX 9.x, but
not Xterm.

BTW, the "^M" stands for control M. You make it by holding down the
control key and typing "vm".

--
David Weintraub                    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
System Configuration Management   _/                                      _/
Dow Jones/Telerate - NSG         _/    I AM THE GREAT AND POWERFUL OZ*   _/


                           *Pay no attention to the man behind the curtains

 
 
 

1. Is "sh file" equivalent to "cat file | sh"

I'd like to know if "sh file" is exactly the same as "cat file | sh". If there
is any difference, what is it? I'd like to know that in order to write a
utility program to unshar a bunch of files, passing the lines to sh via a
pipe.

--
                       ___   __    ___   __    ___  __
 Marc Baudoin         /  /  /  \  /  /  /  \  /    /  \  /   /   Babassez-vous
 le babasseur fou    /  \  /---/ /  \  /---/ /--  /   / /   /    les uns

2. Which is the first Rad tool for Linux? Which is the best?

3. GETSERVBYNAME()????????????????????"""""""""""""

4. wrapping email addressee list when printing

5. Solaris 8 box: cat file | rsh solaris_2.6_box "cat > /dev/null" SLOW

6. Is it Linux ? Or X ? Or HW ?

7. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

8. Modem and sound support question..

9. how to prevent "man" generates "cat" pages?

10. piping "cat" & "find" ?

11. How to set a "Reply-To: " filed in the mail header?

12. problems piping from "split" to "mail" (split | mail)

13. Sendmail: mails rejected with "550-unrouteable mail domain "blade150.lafr.de""