education about perl, part 2
Posted on 2005-04-27
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:
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!