man -> file -> lpr

man -> file -> lpr

Post by Joe Noble (Flashm » Fri, 09 Jun 1995 04:00:00



I looked in the unix.faq and can't find anything on how to take a file
created with:

        man [subject] > file.txt

which creates a file that has all the control codes needed to highlight
topics, etc. for the screen.  How do I take the file thus created and
clear all the control codes so that the output file is pure ASCII.  If
there is an obvious way of doing this, I appologize.  If it's not
possible, please let me know.  I'm trying to do this on a
HP-9000.  A couple of people here at work are interested in being able
to do this "inverse nroff" type function when the source file isn't
available.

THANKS IN ADVANCE
     -joe-
--
---------/ IN PURSUIT OF ALL ANSWERS! - GOT ANY? /----------

 
 
 

man -> file -> lpr

Post by Erik D. McWillia » Fri, 09 Jun 1995 04:00:00



Quote:>I looked in the unix.faq and can't find anything on how to take a file
>created with:
>    man [subject] > file.txt

Try:
        man [subject] | col -b > file.txt

If you're into even more cryptic syntax you can try:
        man [ subject] | sed 's/. //g' > file.txt

There are doubtlessly other ways to do this too.
--
                              The CRT Corporation
                      Computer Based Research and Training


 
 
 

man -> file -> lpr

Post by JaD » Sat, 10 Jun 1995 04:00:00


In days of yore (Thu, 8 Jun 1995 20:59:00 GMT)

::I looked in the unix.faq and can't find anything on how to take a file
::created with:

::      man [subject] > file.txt

        try:

                man | strings > file.txt

        (that seemed to work from the shell where I just
        tried it).

        I seem to recall one time when I did this without strings
        (under DOS) and all I had to do was convert backspaces
        (^H) to *destructive* backspaces using sed or gawk (which
        I always try to keep handy on my DOS boxes).  I did this
        with something like:

                sed 's/.\b//g' gawk.man > gawk.txt

        (in fact that was the only reason I needed it for that
        occasion.  I've used that and similar gawk expressions
        to filter out pesky ^H's from BBS log files (made by
        Procomm, Telix, etc).  I may have needed a couple other
        lines too.  I don't remember.
--
////////////////////////////////////////////////////////////////////////////
JaDeStar
        if ( you.can == read (this) )
           { you.can.be = a - c[programmer]; }

 
 
 

man -> file -> lpr

Post by Cras » Sat, 10 Jun 1995 04:00:00



: I looked in the unix.faq and can't find anything on how to take a file
: created with:

:       man [subject] > file.txt

This will get rid of underlining, boldfacing, and all that stuff, but if
you just want some readable text:

man command | cleanscript > whatever

Provided, of course, your system has cleanscript.

--
 kernel panic -- causal failure                      | G. Branden Robinson

 
 
 

man -> file -> lpr

Post by Joe Noble (Flashm » Sun, 11 Jun 1995 04:00:00




>>I looked in the unix.faq and can't find anything on how to take a file
>>created with:
>>        man [subject] > file.txt
>Try:
>    man [subject] | col -b > file.txt
>If you're into even more cryptic syntax you can try:
>    man [ subject] | sed 's/. //g' > file.txt
>There are doubtlessly other ways to do this too.

I want to thank everyone again for there inputs!  I've tried the:

    man [subject] | col -b > file.txt

and it does exactly what I wanted.  Thank you all for suggesting this
technique and others which I haven't had a chance to try yet, but I'm
sure they'll work.  This is what the Internet is about!

-joe-

--
---------/ IN PURSUIT OF ALL ANSWERS! - GOT ANY? /----------

 
 
 

man -> file -> lpr

Post by Mark Bluem » Wed, 14 Jun 1995 04:00:00


: In days of yore (Thu, 8 Jun 1995 20:59:00 GMT)

: ::I looked in the unix.faq and can't find anything on how to take a file
: ::created with:

: ::    man [subject] > file.txt

:       try:

:               man | strings > file.txt

:       (that seemed to work from the shell where I just
:       tried it).

:       I seem to recall one time when I did this without strings
:       (under DOS) and all I had to do was convert backspaces
:       (^H) to *destructive* backspaces using sed or gawk (which
:       I always try to keep handy on my DOS boxes).  I did this
:       with something like:

:               sed 's/.\b//g' gawk.man > gawk.txt

:       (in fact that was the only reason I needed it for that
:       occasion.  I've used that and similar gawk expressions
:       to filter out pesky ^H's from BBS log files (made by
:       Procomm, Telix, etc).  I may have needed a couple other
:       lines too.  I don't remember.
: --
: ////////////////////////////////////////////////////////////////////////////
: JaDeStar
:       if ( you.can == read (this) )
:          { you.can.be = a - c[programmer]; }

Perhaps this ought to go into the FAQ. IMHO the best bet is to use the
"col" filter to remove the "pesky ^H's" (among other things) :-

        man [command] | col -b > file

col is (I think) a fairly standard (and quite old) command, so should be
pretty generic.

BTW, can I suggest a principle for these groups ? If possible, solutions
should be based on generic, commonly available tools which are part of
the "baseline" for Un*x systems. Not everyone has perl, gawk and so on -
many commercial sites will not use shareware, freeware, public domain etc.

I see so many replies of the form "this takes only 2 lines of perl" and I
feel that it may be more helpful to give solutions which everyone can
understand and use.

This is *not* a flame (really <g>), just my thoughts on how the news groups
work.

--
Mark Bluemel    Unix/Oracle Trainer and Consultant
                My opinions are my own, but I'll share them
                All solutions to problems are offered "as is"
                and without warranty - you have been warned :-)

 
 
 

man -> file -> lpr

Post by Larry Wa » Thu, 15 Jun 1995 04:00:00



: BTW, can I suggest a principle for these groups ? If possible, solutions
: should be based on generic, commonly available tools which are part of
: the "baseline" for Un*x systems. Not everyone has perl, gawk and so on -
: many commercial sites will not use shareware, freeware, public domain etc.
:
: I see so many replies of the form "this takes only 2 lines of perl" and I
: feel that it may be more helpful to give solutions which everyone can
: understand and use.

Unix was not intended to fossilize.

Larry Wall

 
 
 

1. Nowhere Man >> Unix Man 2>/dev/null :-)

Unix Man (Nowhere Man)
                  --------

            He's a real UNIX Man
            Sitting in his UNIX LAN
            Making all his UNIX plans
            For nobody.

            Knows the blocksize from du(1)
            Cares not where /dev/null goes to
            Isn't he a bit like you
            And me?

            UNIX Man, please listen(2)
            My lpd(8) is missin'
            UNIX Man
            The wo-o-o-orld is at(1) your command.

            He's as wise as he can be
            Uses lex and yacc and C
            UNIX Man, can you help me At all?

            UNIX Man, don't worry
            Test with time(1), don't hurry
            UNIX Man
            The new kernel boots, just like you had planned.

            He's a real UNIX Man
            Sitting in his UNIX LAN
            Making all his UNIX  plans For nobody ...
            Making all his UNIX  plans For nobody.

             ==================================

--
Steve Scott     Gentex Corp

2. Win95 -> Linux via null-modem .... help!

3. <><><> MOUNTING EXTENDED PARTITION <><><>

4. MIRRORING disks (or filesystems)

5. Wanted: <><><> Unix Specialist <><><>

6. k6

7. LILO help <><><><><><>

8. Second virtual proxy

9. >>---> Software Jobs! >>--->

10. filter problem with "man <command>|col -bx >file"

11. Setting up a text->LaTeX->file->windoze_printer system?

12. ***>>> Summary: Questions on sending binary files by e-mail <<<***

13. file transfer question: sun<=>telnet<=>terminal server<=>modem ?