Trying to modify a print filter!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Trying to modify a print filter!
# 1  
Old 04-04-2008
Trying to modify a print filter!

Ok, the filter looks like this.

Code:
awk ' BEGIN{printf ("^[E^[&l2a0o7.27C^[(s0p16.67h0T");} \
{ \
printf ("%s^M\n", $0); \
} \
END{printf ("^L^[E");}'



This is sending escape sequences to the printer. What I also would like to do is filter out certain pages. I only want the contant between two markers. Start Marker=1Q2Q3Q4Q, End Marker=5Q6Q7Q8Q. I also need the actual line that the marker is printing on, minus the marker, however, keeping the integrity of all the positions on that line.

Thanks in advance!

Last edited by Yogesh Sawant; 04-04-2008 at 02:40 PM.. Reason: added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Filter records in a huge text file from a filter text file

Hi Folks, I have a text file with lots of rows with duplicates in the first column, i want to filter out records based on filter columns in a different filter text file. bash scripting is what i need. Data.txt Name OrderID Quantity Sam 123 300 Jay 342 498 Kev 78 2500 Sam 420 50 Vic 10... (3 Replies)
Discussion started by: tech_frk
3 Replies

2. UNIX for Dummies Questions & Answers

How to create a print filter that print text & image?

Currently, I have a print filter that takes a text file, that convert it into PCL which then gets to a HP printer. This works. Now I need to embedded a image file within the text file. I'm able to convert the image file into PCL and I can cat both files together to into a single document... (1 Reply)
Discussion started by: chedlee88-1
1 Replies

3. Shell Programming and Scripting

Still print hello2, how to modify this

I want it not print hello2,but for now it print, how could I do,not I want if exit 8 then exit to the whole shell, and don't want to move "exit" from the {} #!/bin/sh start_test() { { echo "hello1" exit 8 } |tee -a qqq echo... (3 Replies)
Discussion started by: yanglei_fage
3 Replies

4. Shell Programming and Scripting

awk Help: Filter Multiple Entry & print in one line.

AWK Gurus, data: srvhcm01 AZSCI srvhcm01 AZSDB srvhcm01 BZSDB srvhcm01 E2QDI31 srvhcm01 YPDCI srvhcm01 YPDDB srvhcm01 UV2FSCR srvhcm01 UV2FSBI srvhcm01 UV2FSXI srvhcm01 UV2FSUC srvhcm01 UV2FSEP srvhcm01 UV2FSRE srvhcm01 NASCI srvhcm01 NASDB srvhcm01 UV2FSSL srvhcm01 UV2FSDI (7 Replies)
Discussion started by: rveri
7 Replies

5. Shell Programming and Scripting

AWK filter from file and print

Dear all, I am using awk to filter some data like this:- awk 'NR==FNR{a;next}($1 in a)' FS=":" filter.dat data.dat >! out.dat where the filter and input data look like this:- filter.dat... n_o00j_1900_40_007195350_0:n_o00j_1940_40_007308526... (3 Replies)
Discussion started by: atb299
3 Replies

6. Shell Programming and Scripting

Modify print of command "ls -l -R"

Hi to all, Some help please, I want to modify using awk the print showed by command "ls -l -R" from: /home/user1/Mydocs/Year/2010/July/Experiments: total 1608 -rw-r--r-- 1 user1 user1 1431 Feb 2 22:45 Experiments1.TAR -rw-r--r-- 1 user1 user1 923 Feb 2 22:45 Tests_Exp1.TXT... (4 Replies)
Discussion started by: cgkmal
4 Replies

7. Shell Programming and Scripting

Filter files and print

Hi, I need to filter and store the files ends with log extension in the array and need to write the file names in the array to a file. I need to use array to derive this solution. Please help me out. Thanks (2 Replies)
Discussion started by: Sekar1
2 Replies

8. Shell Programming and Scripting

Filter the column and print the result based on condition

Hi all This is my output of the some SQL Query TABLESPACE_NAME FILE_NAME TOTALSPACE FREESPACE USEDSPACE Free ------------------------- ------------------------------------------------------- ---------- --------- ---------... (2 Replies)
Discussion started by: jhon
2 Replies

9. Shell Programming and Scripting

Filter by modify date.

I want to filter an "ls -al" command so it only shows me files with modify dates older than two weeks. What is the best way of doing this? (2 Replies)
Discussion started by: millerdc
2 Replies

10. AIX

Modify Print Orientation, Font and Pitch

I need to be able to change the font, pitch, and orientation when printing a text flat file. Any suggestions appreciated. (2 Replies)
Discussion started by: mad_dog
2 Replies
Login or Register to Ask a Question
ppdof(8)						      System Manager's Manual							  ppdof(8)

NAME
ppdof - Text to PostScript translation filter SYNOPSIS
/usr/lbin/ppdof +Cfilename [-n login] [-h host] [...] OPTIONS
Use of the print flags is dependent on the features available on the print device, and on the current status of those features. For exam- ple, when you select a particular paper size, the appropriate paper must be correctly loaded in the paper trays. Options in /etc/printcap The following options are set in the /etc/printcap file and can be specified using the + switch. For example: :if=/usr/lbin/ppdof +Bupper +Cln32.rpd: You can also specify command line options in the /etc/printcap file using the + switch. For example: :if=/usr/lbin/ppdof +Olandscape +Cln32.rpd: Here, the -Olandscape option is specified. Specifies the default tray name to select for printing the banner page. For example: :of=/usr/lbin/ppdof +Bupper +Cln32.rpd: In this example, the banner page will be printed on whatever stock is currently loaded into the upper tray on the selected print device. Specifies the printer configuration file to use for the print job. Specifies the unit of measurement to be inches or cen- timeters for lines per inch (lpi), characters per inch (cpi), and page margin options. The default value is inches. Specifies the default tray name to select for printing the trailer page. For example: :if=/usr/lbin/ppdof +olower +Cln32.rpd: Command Line Options Specify print filter options at the command line using the lpr command as follows. Multiple -O options are supported. Specifies the host name from which the job owner is submitting the print command. Specifies the login (account) name of the job owner. Specifies the name of the output tray where the printed pages are placed. Specifies the page width in columns for portrait and landscape printing. A page width of 0 instructs the filter to use 80 columns in portrait orientation and 132 columns in landscape orientation. Specifies the tray name from which print paper is selected. The printer may select an alternate tray when the paper size provided in the tray does not match the docu- ment requirements. Specifies the number of sides to print on each sheet. You can specify sides as follows: 1 or one - Print on one side of the sheet. 2 or two - Print on both sides of the sheet (duplex printing). Specifies options related to page orientation, formatting, and features as follows: Specifies the number of characters to print per inch. Specifies only even numbered sheets are to be printed. Speci- fies the printed output is parallel to the long side of the page. Specifies the number of lines to print per page. Specifies the number of lines to print per inch. Specifies only odd numbered sheets are to be printed. Specifies the range of pages to be printed, starting with page number m and ending with page number n. Specifies to print the list of options provided by the printer configuration file which includes paper sizes, input and output paper tray names. For example: # lpr -Oprint /etc/motd (Note that the file /etc/motd is specified to satisfy lpr command line requirements, the file itself is not printed.) Specifies the printed output is parallel to the short side of the page. These options specify the various page margins in inches. The page mar- gin sizes in inches as follows: tm= - Top margin in inches. For example -Otm=2 bm= - Bottom margin in inches. For example -Obm=1.5 lm= - Left margin in inches. For example -Olm=1 rm= - Right margin in inches. For example -Orm=3 pm= - Page margin. Using this option sets tm, bm, lm and rm to the same value. For example -Opm=1.25 When configuring the /etc/printcap entry, different margins for landscape and portrait orientation can be specified by adding the suffixes _l and _p respectively. For example: :if=/usr/lbin/ppdof +Olm_p=0.5 +Olm_l=0.25 +Cln32.rpd: DESCRIPTION
The ppdof filter translates ASCII to PostScript and handles the device dependencies of a PostScript printer. It is recommended that the ppdof filter be specified for both the :of and the :if fields in the /etc/printcap file. For a description of these fields, see the printcap(4) reference page. RESTRICTIONS
The commands generated by the ppdof filter to handle device dependencies might be incompatible with some PostScript documents. When a PostScript file does not print correctly use the following command to prevent file preprocessing. # lpr -x file.ps The filter will not setup device dependencies or provide ASCII to PostScript translation for documents containing printer control charac- ters. EXIT STATUS
Any value other than zero (0) indicates that an error has occurred. ERRORS
Use the lf error log field in the /etc/printcap to specify the name of the error log file. SEE ALSO
Commands: cancel(1), lpr(1), pr(1) Files: printcap(4). System Administration ppdof(8)