root/trunk/jps2ps/filtre-file.pl
| Revision 4, 468 bytes (checked in by jms, 7 months ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | ## enleve d'un fichier postscript la fonte dont le nom est passe en parametre |
| 4 | ## syntaxe : |
| 5 | ## cat test.ps | ~/src/perl/filtre-file.pl '%%BeginFont: CMR7' '%%EndFont' |
| 6 | |
| 7 | $tem = 0; |
| 8 | $debut = $ARGV[0]; |
| 9 | $fin = $ARGV[1]; |
| 10 | open (SRC, "-"); |
| 11 | while (<SRC>) { |
| 12 | $ligne = $_; |
| 13 | if ($ligne =~ /^$debut.*/) { |
| 14 | $tem= 1; |
| 15 | } |
| 16 | if ($tem =~ 0) { |
| 17 | print (STDOUT $ligne); |
| 18 | } |
| 19 | if (($tem =~ 1) and ($ligne =~ /^$fin.*/)) { |
| 20 | $tem = 0; |
| 21 | } |
| 22 | }; |
| 23 | close (SRC); |
| 24 | |
| 25 | 1; |
Note: See TracBrowser for help on using the browser.
