Perl Script to Rename Numbered Image Files and Adding or Subtracting from the Image Name
Posted on 2007-03-28
I have a directory of files that I want to copy to a new directory and rename the files.
The directory has images named 01_0001.tif to 01_0963.tif
and when I copy them to the new directory I need the following:
Images 1-4 need to have 3 added to them - 01_0001.tif becomes 01_0004.tif
Images 5-460 need to have 2 added to them - 01_0005.tif becomes 01_0007.tif
He is an example I am going by (we currently have a script doing the adding when the image is called,but now I just want to rename them without using the script that does the adding)
I have multiple variables like this and need to run the script against one directory at a time and the numbers above will always change.
FYI - I am not familiar enough with Perl Script to write this script, but I am familiar enough to understand what is being done and how to change the script. We also are using an older version of Perl. 5 maybe?