tech2040 has asked for the wisdom of the Perl Monks concerning the following question:
You've just loaded a CD's worth of reference images from an outside company. The images follow a naming scheme such as DSCN-1.JPG, DSCN-2.JPG ... DSCN-10.JPG, although the frame numbers may be noncontiguous (i.e., there may be gaps between numbers).
Although the frames were stored in separate directories on the CD-ROM from which they were loaded, all of the frames have now been placed into this directory:
The structure of the directory you've loaded them into is this:/shots/spi/home/pix/out/home_test_v1/misc_bg8
Your task is to rename the frames in accordance with SPI standard naming conventions. These include:/shots/$SHOWNAME/$SHOTNAME/pix/out/$ELEMENTNAME/$RESOLUTION_$COLORSPAC +E
1. No capital letters in the filenames
2. No dashes allowed in the filenames
3. The images should be re-numbered so that they are a contiguous sequence (i.e. no gaps)
4. Frame numbers need to be padded to four-digits. ie, "1" becomes "0001" This is denoted by the symbol # so a range of 1-240 would read 1-240#.
5. The frames should be renamed to match the directory in which they are placed in the following manner:
So, in other words, each frame should become:$ELEMENTNAME_$RESOLUTION_$COLORSPACE.#.$EXTENSION
However, the incoming frames are part of a series and must be kept in the exact same order as they were when loaded (i.e., the incoming frame with the lowest index will map to `home_test_v1_misc_bg8.0001.jpg', while the second lowest index will map to `home_test_v1_misc_bg8.0002.jpg', and so on)./shots/spi/home/pix/out/home_test_v1/misc_bg8/home_test_v1_misc_bg8.00 +01.jpg /shots/spi/home/pix/out/home_test_v1/misc_bg8/home_test_v1_misc_bg8.00 +02.jpg /shots/spi/home/pix/out/home_test_v1/misc_bg8/home_test_v1_misc_bg8.00 +03.jpg ... /shots/spi/home/pix/out/home_test_v1/misc_bg8/home_test_v1_misc_bg8.02 +40.jpg
Please help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: file sorting question
by sk (Curate) on Aug 14, 2005 at 02:52 UTC | |
|
Re: file sorting question
by Zaxo (Archbishop) on Aug 14, 2005 at 02:46 UTC | |
|
Re: file sorting question
by TedPride (Priest) on Aug 14, 2005 at 21:51 UTC |