|
|
1.1 root 1: awk '
2: # new awk script that makes seperate print jobs of large dag PS files.
3: # you may optionally set "jobname" and "jobpages" on the awk command line.
4: #
5: # dag -Tps -p8.5x11 huge.dag >huge.ps
6: # awk -f makejobs.awk jobpages=4 <huge.ps
7: # for psfile in job*.ps
8: # do
9: # lpr $psfile
10: # done
11: BEGIN {
12: printf("job pages are %s\n",jobpages);
13: if (jobname=="") jobname = "job";
14: if (jobpages==0) jobpages=1;
15: job = 0;
16: }
17: (currentpage == 0 && $0 !~ "%%Page") {
18: nhline = NR;
19: header[nhline] = $0;
20: next;
21: }
22: /%%Page/ {
23: currentpage = $3;
24: if (jobpages == 1 || currentpage % jobpages == 1) {
25: if (ofile != "") close(ofile);
26: ofile = jobname job ".ps";
27: job++;
28: print header[1] > ofile;
29: for (i = 2; i <= nhline; i++) print header[i] >> ofile;
30: }
31: }
32:
33: {
34: print $0 >> ofile;
35: }
36: ' $@
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.