[Suggestion] [Feature] Renumber to One

Advanced Renamer forum
#1 : 20/02-16 03:59
Stark Line
Stark Line
Posts: 2
Hello, I'll skip the normal etiquette and get to my point...save for saying thanks for a great app!

I take lots of photos with various cameras. Mostly, my images are named with 4 digits proceeding DCIM, IMG, DSCN, etc.

When I divide the images into sets, it results in filenames that make little send to an end user or client. For instance, 2 sequential sets should each begin with 001.jpg, but my normal workflow results in sets that might begin with 0173 and 9623.

Typically, what I do is use AdvRenamer to subtract 172 and 9622, respectively. In this fashion, each set begins with 001, but also informs the client there are images removed in case they should desire them.

It's my understanding, after researching, that performing this function as a batch (Windows 7), is not possible, as the amount needed to subtract from the first filename (alphabetically) is variable. Currently, I think the only thing I could do is set up numerous AdvRenamer scripts and call each one individually from a batch. This just isn't practical.

It would be fantastic if the ability to perform this task (via a script -> batch) was present in AdvRenamer.

20/02-16 03:59
#2 : 20/02-16 15:02
Kim Jensen
Kim Jensen
Posts: 800
Reply to #1:
Have you tried to use the Renumber method? https://www.advancedrenamer.com/user_guide/metho d_renumber
It can be used to change the numbers relative to the original number. You can also use it to completely renumber the files.

20/02-16 15:02
#3 : 20/02-16 22:42
Stark Line
Stark Line
Posts: 2
Reply to #2:

I tried to explain my suggestion as clearly as possible, but I guess i didn't. I have tried to use Adv Renamer to accomplish my task. If you read my post closer, I think it will become clear.

As it stands, AdvRenamer is not capable of accomplishing my task without manual intervention. In other words, each time I have to use the GUI and type in the correct number to subtract.

I'm looking for a means by which to accomplish this task in an automated way (batch). The algorithm would look something like this:

1. Determine 1st filename (sorted alphabetically or numerically -- lowest to highest).
2. Save that number to a variable (minus one). For example, first filename is 7654. The correct variable should be 7653.
3. Subtract the variable - one (7653) from all filenames in the directory and execute.

The result of this would be a bunch of files, the first of which would be 001.

Does this make more sense?

20/02-16 22:42
#4 : 21/02-16 22:43
Kim Jensen
Kim Jensen
Posts: 800
Reply to #3:
You might get lucky with the Script method. Without knowing the exact file names I cannot be sure the script will work. This is my best guess of a working script:
var firstFileNumber = app.getItem(0).name.match(/\d+$/)[0];
var num = parseInt(firstFileNumber, 10);
var itemSplitName = item.name.match(/(.+\D)(\d+)$/);
var itemNumber = parseInt(itemSplitName[2], 10);
return itemSplitName[1] + (itemNumber - firstFileNumber + 1);

You might need to use Renumer method afterwards to pad the numbers with zeros.

21/02-16 22:43