Hi everyone I need some help.
I have a directory of images which are named something like this:
1.jpg
2.jpg
3.jpg
4.jpg
5.jpg
6.jpg
7.jpg
8.jpg
9.jpg
10.jpg
11.jpg
12.jpg
A script I'm working on deletes (unlinks) just one of these - say 3.jpg, leaving:
1.jpg
2.jpg
4.jpg
5.jpg
6.jpg
7.jpg
8.jpg
9.jpg
10.jpg
11.jpg
12.jpg
What I want to do is to add on to the end of this script a routine which renames the images left, in a way that will preserve the best sequence of names. So that, for the example above, the image names get renamed so that the names would be:
1.jpg (was 1.jpg)
2.jpg (was 2.jpg)
3.jpg (was 4.jpg)
4.jpg (was 5.jpg)
5.jpg (was 6.jpg)
6.jpg (was 7.jpg)
7.jpg (was 8.jpg)
8.jpg (was 9.jpg)
9.jpg (was 10.jpg)
10.jpg (was 11.jpg)
11.jpg (was 12.jpg)
I've been tweaking my script all over the place with no good results, so I thought I'd see what everyone else's approach would be.
Thanks in advance!