jingmcgill has asked for the wisdom of the Perl Monks concerning the following question:
Thanks a lot!#!/usr/bin/perl $write_dir="C:\\directoryB"; my @files=<C:/directoryA/*>; foreach $file (@files) { open (FILE,"$file"); while ($line=<FILE>){ print "$file\n" if $line=~/keyword/; } close FILE; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: write multiple files to a new directory
by stevieb (Canon) on Oct 23, 2015 at 20:09 UTC | |
by Anonymous Monk on Oct 23, 2015 at 22:20 UTC | |
|
Re: write multiple files to a new directory
by toolic (Bishop) on Oct 23, 2015 at 20:11 UTC | |
|
Re: write multiple files to a new directory
by AnomalousMonk (Archbishop) on Oct 24, 2015 at 11:21 UTC | |
|
Re: write multiple files to a new directory
by ww (Archbishop) on Oct 25, 2015 at 12:54 UTC |