in reply to Removing lines from files
#!/usr/bin/perl use warnings; use strict; use File::Find; @ARGV == 1 or die "usage: $0 directory_name\n"; my @files; find sub { if ( -f and /^33dc01\..*outer\.log$/ ) { push @files, $File::Find::name; print "$File::Find::name\n"; } }, $ARGV[ 0 ]; ( $^I, @ARGV ) = ( '', @files ); while ( <> ) { next if $. <= 4; print; close ARGV if eof; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Removing lines from files
by learningperl01 (Beadle) on May 13, 2008 at 14:25 UTC | |
by jwkrahn (Abbot) on May 13, 2008 at 21:52 UTC |