in reply to Concatenating content of many files from different directories into one big file

Here is a moderately tested File::Find example
#!/usr/bin/perl use warnings; use strict; use File::Find; # get dir names from command line or use default of current dir my @dirs = @ARGV ? @ARGV : '.'; my $big_file = '/home/zentara/1down/5/big_file'; open OUT, '>', $big_file or die "Cannot open $big_file: $!"; find( sub { return unless -f; return unless $_ =~ /^A\.rpt$/; open RPT, '<', $_ or die "Cannot open $File::Find::name: $!"; print OUT <RPT>; print OUT "\n"; }, @dirs ); __END__

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: Concatenating content of many files from different directories into one big file
  • Download Code