Feature request about zero-padding

Advanced Renamer forum
#1 : 03/04-19 03:24
subdiox
subdiox
Posts: 2
I found an issue related to zero-padding.
It seems impossible to use zero-padded number and non-zero-padded number at the same time.

When I turn on the zero-padding option in the Settings window, <Inc Nr:1> will become 01,02,03... when I import 10 or more files. In this setting, I have no way to set the file name like `[01] Great Name 1.mp4`, `[02] Great Name 2.mp4`.
I think <Inc Nr:1> should become 1,2,3,... instead of 01,02,03,... in order to use 01,02,03,... and 1,2,3,... at the same time.

If I turn off the zero-padding option, <Inc Nr:01> becomes 1,2,3,... and <Inc Nr:1> also becomes 1,2,3,...
So this is not useful at all.


03/04-19 03:24 - edited 03/04-19 03:25
#2 : 03/04-19 10:40
David Lee
David Lee
Posts: 1125
Irrespective of your choice of zero-padding, ARen will add leading zeros to an <Inc Nr> tag, where necessary to ensure all added numbers are of the same length.

This means that for numbers between 1 & 9, <Inc Nr:1> will return "1, 2 ... 9" etc, between 1 & 99: "01, 02, ... 99", between 1 & 999: "001, 002 ... 999" and so on.

This behaviour is logical but not always what you desire.

The simplest work-around is to use a regular expression in a script, to remove the unwanted leading zeros:

var pre = app.parseTags("[<Inc Nr:01>] ");
var post = app.parseTags("<Inc Nr:1>") ;
post = " " + post.replace(/^0*/, "");
return pre + item.newBasename + post;

(See www.w3schools.com/Js/js_regexp.asp)


03/04-19 10:40 - edited 03/04-19 17:06
#3 : 11/04-19 12:05
subdiox
subdiox
Posts: 2
Thank you for telling me the way of workaround.

But I think it should have an option to remove unwanted zero, without using javascript.
It is not cool at all. I would like the developer to update the software to support this feature.


11/04-19 12:05