How to print a specific page


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to print a specific page
# 1  
Old 01-31-2007
How to print a specific page

Hi there,

Does anyone know how to print a specified page using command like lpr?


Thanks,
# 2  
Old 01-31-2007
You're better of just creating a tmpfile with the one page and printing that
Assuming 66 lines per page with no page feed (ASCII 12) embedded:
Code:
# $1 = page number
pr +"$1" bigfile | awk 'NR<67' > tmpfile

tmpfile now is a 66 line file to send to lpr
See man pr to change page length
# 3  
Old 01-31-2007
What if there is a page feed embeded?
# 4  
Old 01-31-2007
Code:
sed 's/^L//g bigfile | pr +"$1" | awk 'NR<67' > tmpfile

where ^L is ctrl-L.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print multiple specific column after a specific word?

Hello.... Pls help me (and sorry my english) :) So I have a file (test.txt) with 1 long line.... for example: isgc jsfh udgf osff 8462 error iwzr 653 idchisfb isfbisfb sihfjfeb isfhsi gcz eifh How to print after the "error" word the 2nd 4th 5th and 7th word?? output well be: 653 isfbisfb... (2 Replies)
Discussion started by: marvinandco
2 Replies

2. Shell Programming and Scripting

How to print with awk specific field different from specific character?

Hello, i need help with awk. I have this file: cat number DirB port 67 er_enc_out 0 er_bad_os 0 DirB port 71 er_enc_out 56 er_bad_os 0 DirB port 74 er_enc_out 0 er_bad_os 0 DirB port 75 ... (4 Replies)
Discussion started by: elilmal
4 Replies

3. UNIX for Dummies Questions & Answers

How to Detect Specific Pattern and Print the Specific String after It?

I'm still beginner and maybe someone can help me. I have this input: the great warrior a, b, c and what i want to know is, with awk, how can i detect the string with 'warrior' string on it and print the a, b, and c seperately, become like this : Warrior Type a b c Im still very... (3 Replies)
Discussion started by: radynaraya
3 Replies

4. Shell Programming and Scripting

Print multiple copies page by page using lp command

Hi I have a pdf file that is being generated using the rwrun command in the shell script. I then have the lp command in the shell script to print the same pdf file. Suppose there are 4 pages in the pdf file , I need to print 2 copies of the first page, 2 copies of the second page , then 2... (7 Replies)
Discussion started by: megha2525
7 Replies

5. Slackware

Printer won't print but 1 page

OS: Slackwar 13.37 Printer: hpDeskjet 1000 j110 Printer Drivers/Software: HPLIP 3.11.3a (min was 3.10.9) and Cups The printer will print the first of n-pages but from page 2 on it prints the page (or part of it) backs up and starts again down about 0.8 lines and does this repeatedly till the... (2 Replies)
Discussion started by: slak0
2 Replies

6. Shell Programming and Scripting

Print Specific lines when found specific character

Hello all, I have thousand file input like this: file1: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$ | | | |$$ $$ UERT | TTYH | TAFE | FRFG |$$ $$______|______|________|______|$$ $$ | | | |$$ $$ 1 | DISK | TR1311 | 1 |$$ $$ 1 |... (4 Replies)
Discussion started by: attila
4 Replies

7. Shell Programming and Scripting

print first few lines, then apply regex on a specific column to print results.

abc.dat tty cpu tin tout us sy wt id 0 0 7 3 19 71 extended device statistics r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0 0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies

8. UNIX for Dummies Questions & Answers

print job seperator page

How do I get my linux login ID to print on seperator page on print jobs. Right now it prints " Remote User" thanks Jim (0 Replies)
Discussion started by: jdmowrer
0 Replies

9. Shell Programming and Scripting

lpr- how to print from page to page

hi all i have file_1 which contains 66 pages and i want to print only page 1 to 3 i try to write like this lp -d name_of_printer file_1 -P 1-7 this command does not work any ideas ? (4 Replies)
Discussion started by: naamas03
4 Replies

10. UNIX for Dummies Questions & Answers

How to print multi page to one for pdf in unix??

I need help on printing PS and PDF file. I find it will waste a lot of paper if I print every pages. So I want to print multipage into one. But I forgot how to do it in unix. Anyone help me!!! :D ;) :p (2 Replies)
Discussion started by: sunartio
2 Replies
Login or Register to Ask a Question