counting up hexadecimal

Advanced Renamer forum
#1 : 24/05-13 14:01
Steven Smith
Steven Smith
Posts: 1
Hello community!

I have a very specific problem. I need to outsmart my scanner and for this reason I have to save 200 images with counted up hexadicimal numerals. Is there any possibility to count up with hexadecimal numerals instead of Arabic numerals? If not, would it be possible to integrate such a function into future versions? Thank you for your answers!


24/05-13 14:01
#2 : 25/05-13 19:58
Stefan
Stefan
Posts: 274
Reply to #1:

Hi.

There is (afaik) no option to serialize with hexadecimal numerals.

But we can use a JavaScript rule.


Or utilize the List rule.
See http://www.advancedrenamer.com/user_guide/metho d_list


Therefore we need a list with 200 hexadecimal numerals from 01 to C8.

The list could look like this, if you want to keep the origin name:

<name> 01
<name> 02
<name> 03
...
<name> 10
...
<name> 63
...
<name> C8




If you want to drop the origin numbering, i.e. for example
the last three signs like '001', '002', '003' use

<RSubstr :POS:COUNT:START>

see http://www.advancedrenamer.com/user_guide/tags_ advanced

<RSubstr:4:999> 01
<RSubstr:4:999> 02
<RSubstr:4:999> 03


The list itself can be easily made by using a spreadsheet, a text editor or by an script language.


25/05-13 19:58
#3 : 26/05-13 12:27
Stefan
Stefan
Posts: 274
Reply to #2:

This is a VisualBasic Script to create a text file to use in the List rule:

-------------------------8<-------------------

'//Create a list and write to file
'// U s e r S e t t i n g s
OutputFile = "hexadecimal.txt"
AREN_Param = "<RSubstr:4:999> "

'// T h e C o d e
For i = 1 to 200
HexNum = hex(i)
While len(HexNum) < 2
HexNum = "0" & HexNum
Wend
out = out + AREN_Param & HexNum & vbCRLF
Next
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = FSO.CreateTextFile( OutputFile, True)
objTextFile.Write (out)
objTextFile.Close
msgbox "done, see " & OutputFile
'//Fininshed

------------------------->8-------------------




Save it as plain text file with .VBS extension and double click on it.



This creates a new file with an content like:

<RSubstr:4:999> 01
<RSubstr:4:999> 02
<RSubstr:4:999> 03
<RSubstr:4:999> 04
<RSubstr:4:999> 05
<RSubstr:4:999> 06
<RSubstr:4:999> 07
<RSubstr:4:999> 08
<RSubstr:4:999> 09
<RSubstr:4:999> 0A
<RSubstr:4:999> 0B
<RSubstr:4:999> 0C
<RSubstr:4:999> 0D
<RSubstr:4:999> 0E
<RSubstr:4:999> 0F
<RSubstr:4:999> 10
<RSubstr:4:999> 11
<RSubstr:4:999> 12
...




Copy and paste that list to the List rule.




.


26/05-13 12:27
#4 : 27/05-13 10:37
Kim Jensen
Kim Jensen
Administrator
Posts: 883
Reply to #1:
Try this little neat trick with scripting. Add the scripting method and use this script:

var s = index.toString(16);
if (s.length == 1)
s = "0" + s;
return s.toUpperCase();


If you don't want to name to be uppercase, then remove the .toUpperCase() part.

The sequence of numbers start at 0. It is possible to start at another number is that is preferred. Let me know if that is the case.


27/05-13 10:37