[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: suppressing special output from troff -Tascii


> I am trying to transfer some troff files to straight ascii, but I keep
> getting intermixed control characters and extra characters in its attempt
> to deal with bold, underscore, and other format issues.
> Is there a way to get troff to not do these formatting steps? As an
> alternative how can I get sed or some other text manipulator to take
> the three character sequence <characterX><control-H><characterX> into
> simply <characterX>?

As far as I can tell, the following will do it.

 sed -e 's/.'$'\b''//g' < troff-file > ascii-file

where troff-file is your troff-formatted file, and ascii-file is where
you want to put the plain ascii output.  The ugly $'\b' in the middle
is a way to tell bash you want a backspace character passed.  If you
don't use bash, you'll have to take a peek at your shell's manual.

I tried it with a few manpages, looks good.

- -- 
Benoit Goudreault-Emond
Reply to: bgoudem@qualiscope.axess.com
PGP public key fingerprint: 11 43 A9 04 7C 11 41 44  5F FC 69 B1 B6 0A ED 78
E-mail me to receive the actual public key.
Version: 2.6.3i
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface


TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: