Link to home
Start Free TrialLog in
Avatar of will1383
will1383

asked on

education about perl, part 2

I'm working on a perl script that is going to grab a bunch of files from a directory, rename them according to what they are called, create a new timestamp-based folder and move the newly renamed files into the new time-stamped based directory.  I understand software concepts, but the regular expression stuff is still very difficult for me.

I am now creating the directory and reading the source directory and successfully moving the files.  Now I need to rename the files.

Here's the file names before rename:
Server01__NEWFIRST.2005.02.14.16.10.rpy
Server04__NEWFIRST.2005.02.14.15.28.rpy

Here's the desired file name after the rename:
Server01__NEWFIRST.2005.02.14.16.10.rpy -> NovOval_2005-02-14_16-10.rpy
Server04__NEWFIRST.2005.02.14.15.28.rpy -> IntRC_2005-02-14_15-28.rpy


Now i have a bunch of other files with different server names but this should give you the gist of what I'm trying to do.  I'm currently looping through the directory and grabbing each file individually, hoping to rename them according to the convention above, and then copy them over.

Any suggestions?  Thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial