Using a starting number with UniqueCounter

  • 367 Views
  • Last Post 31 October 2019
  • Topic Is Solved
patrick.loxhay posted this 24 October 2019

Hi

I have been using the %UNIQUECOUNTER% variable and find that it does not populate with a number unless a file already exists in the output folder location.  For example, if I had a file name that was Document_%UNIQUECOUNTER% it would write the first file name as Document_  .  I have tried the setting to dictate the starting number and length of the unique counter i.e %UNIQUECOUNTER(1+1)% but that did not make any difference.

Is there a way of getting the Unique Counter to have a starting number regardless of a file name already existing? 

 

  • Liked by
  • TimWagner
Order By: Standard | Newest | Votes
luigi.zurolo posted this 25 October 2019

Hi Patrick,

 

correct, this behavior has been standard for the simple reason that the unique counter has meaning when the file already exists and it starts counting to avoid to overwrite it.

However if you use the latest internal build available additional parameters have been added to the variable so that you can also customize this option, the counter now works like below:

%UNIQUECOUNTER% = initially not existing when file doesn't exist
%UNIQUECOUNTER3% = initially not existing when file doesn't exist, it is formatted by x (3) digits (e.g. 000)
%UNIQUECOUNTER3+7% = initially not existing when file doesn't exist, it is formatted by x (3) digits and starting from y (7) (e.g. 007)
%UNIQUECOUNTER3+7I% = (Inclusive) same as before but initially inclusive (so first file it will come directly with 007 rather than empty) -> this is your case
%UNIQUECOUNTER3+7+_% = existing or not initially according the usage of I which can be added or not but using the _ character as separation from the previous filename (e.g. _007). This is for cases when you don't want the extra char when the counter isn't used (example without I so counter not used initially) because if you put the _ in the filename then the initially filename will just end in _ being without the counter.

  • Liked by
  • Matthias
  • TimWagner
patrick.loxhay posted this 29 October 2019

Hi Luigi

Thanks for that information.  I tried it out and it works perfectly.  FYI, the manual (even the online one) has the syntax the wrong way around for the start number and the length.  This is the extract from the online manual :-

 

UNIQUECOUNTER(start+sizenumber)

Unique number which increases when name/file exists, in this case it start from specific number with size number format (e.g. UNIQUECOUNTER(3+4) -> 1st: 0003 2st: 0004 ....10st: 0010...)

 

regards

 

Patrick

luca.scarpati posted this 31 October 2019

Hi Patrick,

 

ok perfect and more than welcome.

Yes you are right for the manual, we already had it in our "to-do" list for the next version (the manual changes when there are official versionsinnocent).

Thanks for your feedback!

 

Best regards,

Luca

Close