Hi Monks,
I have to read the directory and fetch the txt file and match the name (partial_pressps_report), if the file name contains (partial_pressps_report$i) $i(1 or 2 or 3) then ($i) should be incremented and printed
use strict; use warnings; my $topdir = 'D:/PGN/ELSEVIER/FNS/1(1)/press'; opendir(HU, "$topdir"); my @files = grep(/\.txt$|.TXT$/,readdir(HU)); closedir(HU); my $ucount = 0; foreach(@files) { my $frame = $files[$ucount]; if($frame =~m#^partial_pressps_report#gs) { my $frameu = my $frame; } else { print "$frame"; } $ucount++; }
Thanks,
W. Ahmed
In reply to name of the last file by basheer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |