I want to extract a specific page/section from a file in the print spooler and print it.
This is possible via the following procedure:
- Select the spooler document you want.
- Use the 'V'iew option
This will display on the screen the start of the document. Use eitherPageUp / PageDown or to locate the start of the text
Search (using /text e.g. /BROWN) - Press 'v' to jump into the editor (vi)
- Position the cursor (via arrow keys etc.) to the 1st line.
(Once finished with the stuff below, type <ESC>:q to return to the viewer, then q to return to menu.)
Now there are different ways to do what you want. They are listed here so you can pick the one you happy with:
- By Line Number:
Press <ESC> :, at the : prompt type set nu
This causes the system to number every line, work out start finish line number and type:
<ESC> : followed by:100,200 w !lp (Print lines 100 to 200 on printer) .,200 w !lp (From current line to line 200 send to printer) Note: The line numbers are only displayed on the screen they do not affect the document.
- Match
Press <ESC>: followed by:
.,/INVO/ w !lp (From current line to first line containing the text INVO and send to printer.) 1,/INVO/ w !lp (From line 1 to first line containing the text INVO and send to printer.) - 'Yank' the stuff to a file and edit it.
The above examples are sending to the printer. If on the other hand you want to send it to a file, tidy up the file and then print it. - Instead of w !lp use w! /tmp/xxx (where xxx is the name). You can then edit (with vi/pico/ee/ste) the file /tmp/xxx and then print it with lp /tmp/xxx.