[Novalug] Extracting content of email
scepticanagramwonk at verizon.net
Mon Feb 9 08:42:14 EST 2009
On Mon, 2009-02-09 at 01:43 -0500, Charles M Howe wrote:
> I wish to the content of an email and discard the routing information. ,
> but maybe I worry two much. Maybe they are all ascii. I found my copy of
> "Learning vi", the lost it again immediately. Real soon now I am going
> to straiten it out and otherwise organize my life.
I know if I save an email it is ascii. Type >file <file_name> and it will tell you.
Google learning vi. There is a wealth of information on it. If you are
only saving a handful of emails, bring it up in vi and type
Broken down, the : lets you type a command
1,/^$/ says go from line 1 to the first line that matches this pattern
(this pattern is an empty line). Look this up online for defs of
d says delete.
Thus, if you find a better line to chop it at, just replace the
pattern. If you mess it up, just type 'u' (sans the qoutes to undo.)
> (1) How do I do this? I am almost certain that it can be be automated,
> and easily could already be done by a well-known program. Couldn't it be
> a bash script? Would writing such a script be an exercise for a CS
> class? Is it already that, i.e. a frequently asked class questions?
This could be done rather handily in a bash script (with sed and awk) or in a perl script. I can write one later tonight, or tomorrow if no one else helps.
> (2) What text editor handles the output? vi would be preferable. What
> other editors put out information in a format that is native to vi?
???? I don't know what you mean. Vi reads an ASCII file. If there are special characters or markups, you will see them; but not wysiwyg style.
> (3) How can I change the size of vi text if I want to print an email
> message (bigger and smaller; type size settable.
I don't know this one. Start here: http://en.wikibooks.org/wiki/Learning_vi
You can also man vi. You will learn this editor by using it. It is
imperative to know, as it is on just about every system. Plus it is
> and in two related sets of questions (I think I have asked this before)
> (4) Can I go from vi-recognize characters and OO word Processor to vi
> (5) vice-versa.
Save As a text file in 00 and you will be fine.
Hope this helps,
More information about the Novalug