in reply to how do i parse multiple files and write all of the results into single file
my @files = glob( '2005*@*.log' ); die "No files found\n" unless @files; open(OUTPUT, ">output" ) or die "Unable to open output\n$!\n"; foreach my $file (@files) { open( MYFILE, $file ) or die "Unable to open $file\n$!\n"; while (<MYFILE>) { # parse print OUTPUT $parsed_output; } close (MYFILE) or die "Unable to properly close $file\n$!\n"; } close(OUTPUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how do i parse multiple files and write all of the results into single file
by QM (Parson) on Jul 08, 2005 at 18:22 UTC | |
|
Re^2: how do i parse multiple files and write all of the results into single file
by my_perl (Initiate) on Jul 08, 2005 at 18:10 UTC |