Can anybody give me some help for figuring out the problem below.
Here are some facts:
-
I am using Windows XP.
-
We have the directory
/abc5/def/ghi/dcl_201107_hy79u_02. In which the inner sub-directory name (thedcl_201207_hy79u_02part) changes every week using the following rule:dcl_<year><week>_hy79u_<some_number>e.g.
dcl_201208_hy79u_05for the 8th week anddcl_201209_hy79u_06for the 9th week.As far as we are concerned, the
<some_number>part (ie 02, 05 or 06) is some random number. -
Under this directory there will be 60 files and those file names would be like:
dcl_201207_hy79u_02_epoc32_include_internal.zip
Now what I am trying to implement is this:
Every week a new dir is created on FTP server and we have to copy some 64 files out of 100 files. How I am proceeding is to copy all the 64 files names in a text file and reading each line and pulling the file I want. The problem is that I am not able to find the latest created folder and also I am not able to modify those files name according to the week.
I tried to use template as suggested by this community but I failed as beging very new to Perl 🙁
So I am trying to replace the string dcl_201207_hy79u_02 in every file wherever I get it.
e.g. for the 8th week dir name would be dcl_201208_hy79u_05 then replace this string in every file.
If you have the week number in
$w, the functionsprintf("week%02dsuffix", $w)returnsweek01suffixwhen$wis 1, etc.