LeeC79 has asked for the wisdom of the Perl Monks concerning the following question:
An example of a filename that I want is:my $search_string = "C04*".substr($year, 2, 2).$month.$day."*.ORD_API" +; my $dir = "C:\\done\\"; my $file; my $i; opendir DIR, $dir; my @file = grep {!/^$search_string/} readdir DIR; closedir DIR; foreach $file(@file){ print $dir.$file[$i]."\n"; $i++; }
The problem is I'm getting all files in the directory I'm searching. Thanks for any help.C04SHP04071500098417.ORD_API
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with grep
by Art_XIV (Hermit) on Jul 16, 2004 at 17:38 UTC | |
by LeeC79 (Acolyte) on Jul 16, 2004 at 17:47 UTC | |
|
Re: Help with grep
by keszler (Priest) on Jul 16, 2004 at 17:43 UTC | |
|
Re: Help with grep
by eric256 (Parson) on Jul 16, 2004 at 17:27 UTC | |
by LeeC79 (Acolyte) on Jul 16, 2004 at 17:32 UTC |