Just for fun.....
#!/usr/bin/perl use warnings; use strict; my @prints; while (<DATA>) { chomp; $prints[--$_]="print this one"; } open IN, '<', 'grep' or die 'dulce et decorum est'; open OUT, '>', 'gout' or die 'dulce et decorum est'; while (<>) { print OUT if shift @prints } close IN; close OUT; __DATA__ 1 3 5 8
Cheers,
R.
In reply to Re: printing specific lines
by Random_Walk
in thread printing specific lines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |