Article View: aus.computers.linux
Article #54715Re: word processors
From: James Cribb
Date: Fri, 19 Sep 1997 00:00
Date: Fri, 19 Sep 1997 00:00
36 lines
1912 bytes
1912 bytes
David Boston <bosto@ozemail.com.au> writes:
|
| On a related note - does anyone out there know if there are macros for
| vi or emacs allowing them to display text that is in microsoft's
| document format?
I wrote this quickie program when people started sending me one- or
two-paragraph Word documents as mail attachments. It is handy, but
loses any fancy formatting though. I call the program "mwd", so to run
it in a shell:
mwd blah.doc
----------------------------------------------------------------------
#!/bin/sh
# (Attempt to) Translate Microsoft Word document into text and view with
# the pager.
cat "$@" |
tr "\015\221\222\223\224" "\012\`'\"\"" | # Newlines, apostrophes, quotes
tr -s '\007\377\013\014' ' ' |
tr -dc '[:space:][:print:]' |
fmt -80 -s |
${PAGER:-more}
----------------------------------------------------------------------
It is incredibly wasteful to send short messages as Word attachments.
The worst case I have seen was 373 bytes of text, add header and
signature, redundant for a mail message (579 bytes), put into Word .DOC
format (11264 bytes), and uuencoded for mail (15550 bytes), so that only
2.3% of the package was content. This was then sent to a "broadcast"
mail address (expanded into the "to" field -- 28k bytes) and copied to
the mailbox of everyone in the company (somewhere between 14 and 28 MB).
If anyone can beat this, I'd like to hear about it.
Technical Details
Message-ID:
<5vti6v$c3r$1@the-fly.zip.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<341AA3D0.5FA3@cygnus.uwa.edu.au> <m2g1r6nc5t.fsf@reddwarf.aup.com.au> <341FE17B.D633C2E7@ozemail.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102983,77d184005c2fc836 X-Google-Attributes: gid102983,public From: jamesc@zipper.zip.com.au (James Cribb) Subject: Re: word processors Date: 1997/09/19 Message-ID: <5vti6v$c3r$1@the-fly.zip.com.au> X-Deja-AN: 273882029 References: <341AA3D0.5FA3@cygnus.uwa.edu.au> <m2g1r6nc5t.fsf@reddwarf.aup.com.au> <341FE17B.D633C2E7@ozemail.com.au> Organization: The Zipsters Newsgroups: aus.computers.linux