Difference between revisions of "ReNamer:Rules:Serialize"

From den4b Wiki
Jump to navigation Jump to search
(navigation)
(→‎Numbering system: Music notes system added)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Go|up=ReNamer:Rules|prev=ReNamer:Rules:Case|next=ReNamer:Rules:CleanUp}}
+
{{Go|up=ReNamer:Rules|prev=ReNamer:Rules:Case|next=ReNamer:Rules:Randomize}}
  
 
== Serialize Rule ==
 
== Serialize Rule ==
<center>[[Image:SerializeRule.png]]</center>
 
  
This rule works on a set of files, and inserts incremental numeric series or random sequences of digits in the names of those filenames.
+
[[Image:SerializeRule.png|center]]
  
When the ''incremental'' option is chosen, the files listed in the pane are numbered in ascending order. Thus, the position of the file in the '''Files''' pane becomes important. Check the order of the files in the list before applying this rule.
+
This rule works on a set of files, and inserts incremental numeric series of digits in the names of those filenames.
 +
 
 +
The files listed in the pane can be numbered in increasing or decreasing order, with various steps, repeat and reset configuration. The position of each file in the '''Files''' pane becomes important, so check the order of the files in the list before applying this rule.
  
 
Examples:
 
Examples:
Line 17: Line 18:
 
{| class="wikitable"
 
{| class="wikitable"
 
! Parameter
 
! Parameter
! Details
+
! Description
  
 
|-
 
|-
| Incremental
 
| Inserts serialized numbers in the names of the files placed in the Files pane of ReNamer.
 
 
{| class="prettytable"
 
 
| Index start
 
| Index start
| Starting number. If the folder already has some files with serialized numbers, start with the next number.
+
| Starting number. For example, if the destination folder already has some files with serialized numbers, you can start with the next number.
  
 
|-
 
|-
 
| Step
 
| Step
| Usually 1, but you may like to enter a higher number here if files with intermediate numbers are expected later.  
+
| Increment the index by this value after each processed file. Usually 1, but you may like to enter a higher number here if files with intermediate numbers are expected later. Also, negative numbers can be used to make decremental indexes, e.g. -1, -2, -3, etc.
  
 
|-
 
|-
| Reset if folder changes
+
| Repeat
| Since ReNamer can work on files collected from multiple folders, this control allows you to reset the counter for each of those folders. The effect is as if you are repeating the same commend for each of the folders separately.
+
| How many times to repeat (reuse) the same index before incrementing it.
  
|}
+
|-
 +
| Reset every
 +
| Reset index to the initial value after processing this many files.
  
 
|-
 
|-
| Random
+
| Reset if folder changes
| Inserts a random number in the file name.
+
| Since ReNamer can work on files collected from multiple folders, this control allows you to reset the counter for each of those folders. The effect is as if you are repeating the same command for each of the folders separately.
  
{| class="prettytable"
+
|-
| Length
+
| Reset if file name changes
| Specify how many digits your random number should have.  
+
| Reset the counter when the file name changes. This option is especially useful for fixing (serializing) duplicated file names, when the files with the same name are grouped together, which can be achieved by sorting the files by name or path.
  
* ReNamer will create random numbers with specified length (number of digits). So a length of 4 means the random digits will be from 0000 to 9999 (inclusive).
+
|-
 
+
| Pad with zeros to length
* Note that random numbers are padded with leading zeroes by default
+
| Pad the inserted number with leading zeros. For example, "457" becomes "000457" if it is padded to reach 6 digits, and "0457" if padded to 4 digits.
  
 
|-
 
|-
| Unique if possible
+
| Insert where
| Normally, random numbers can repeat themselves. If this option is selected, ReNamer will try to use unique numbers.  
+
| Specify where to insert the number (see below for individual options).
  
 
|}
 
|}
  
|-
+
=== Insert location ===
| Pad with zeros to reach length
+
 
| ReNamer will pad the remaining places with leading zeros. For example 457 becomes 000457 if it is padded to reach 6 digits, and 0457 if padded to 4 digits.
+
Options for where to insert the number:
 +
 
 +
{| class="wikitable"
 +
! Option
 +
! Description
  
 
|-
 
|-
| Insert where
 
| Specify where to insert the number.
 
 
{| class="prettytable"
 
 
| Prefix
 
| Prefix
 
| Before the original filename
 
| Before the original filename
Line 70: Line 69:
 
| Suffix
 
| Suffix
 
| After the original filename
 
| After the original filename
 
* If the '''skip extension''' option is selected, the specified text will be inserted ''before'' the extension.
 
  
 
|-
 
|-
 
| Position
 
| Position
 
| Insert the number at the specified position.
 
| Insert the number at the specified position.
 +
 +
|-
 +
| Replace current name
 +
| Inserted number replaces the entire filename.
 +
 +
|-
 +
| Skip extension
 +
| Exclude file extension when calculating the position for insertion.
  
 
|}
 
|}
Note that if the "''pad with zeros''" option (above) is selected, the ''padded '' number is inserted.
+
 
 +
=== Numbering system ===
 +
 
 +
A choice of the '''Numbering system''' dictates which symbols and enumeration technique are used for the serialization.
 +
 
 +
{| class="wikitable"
 +
! Number system
 +
! Description / Examples
 +
 
 +
|-
 +
| Decimal digits
 +
| Index starts at 0 with repeat 1 and step 1:<br/>
 +
<tt>0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, …</tt>
 +
 
 +
|-
 +
| English letters
 +
| Index starts at 1 with repeat 1 and step 1:<br/>
 +
<tt>a, b, c, …, x, y, z, ba, bb, bc, …, bx, by, bz, ca, cb, cc, …, zx, zy, zz, baa, bab, bac, …</tt>
 +
 
 +
Index starts at 1 with repeat 1 and step 1, pad to length 3:<br/>
 +
<tt>aaa, aab, aac, …, aax, aay, aaz, aba, abb, abc, …, abx, aby, abz, aca, acb, acc, …, azx, azy, azz, baa, bab, bac, …</tt>
 +
 
 +
|-
 +
| Roman numerals
 +
| Index starts at 1 with repeat 1 and step 1:<br/>
 +
<tt>I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, …</tt>
 +
 
 +
|-
 +
| Music notes
 +
| Index starts at 1 with repeat 1 and step 1:<br/>
 +
<tt>C0, C#0, D0, D#0, E0, F0, F#0, G0, G#0, A0, A#0, B0, C1, C#1, …</tt><br/>
 +
''Added in ReNamer 7.3.0.2 Beta.''
 +
 
 +
|-
 +
| Simplified Chinese
 +
| Index starts at 1 with repeat 1 and step 1:<br/>
 +
<tt>一, 二, 三, 四, 五, 六, 七, 八, 九, 一十, 一十一, 一十二, 一十三, …</tt>
 +
 
 +
|-
 +
| Custom alphabetic
 +
| Index starts at 1 with repeat 1 and step 1, using "ABC" symbols:<br/>
 +
<tt>A, B, C, BA, BB, BC, CA, CB, CC, BAA, BAB, BAC, BBA, …</tt>
 +
 
 +
Index starts at 1 with repeat 1 and step 1, using "01" symbols:<br/>
 +
<tt>0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, …</tt>
 +
 
 +
|-
 +
| Custom numeric
 +
| Index starts at 0 with repeat 1 and step 1, using "ABC" symbols:<br/>
 +
<tt>A, B, C, BA, BB, BC, CA, CB, CC, BAA, BAB, BAC, BBA, …</tt>
 +
 
 +
Index starts at 0 with repeat 1 and step 1, using "01" symbols:<br/>
 +
<tt>0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, …</tt>
  
 
|}
 
|}
 +
 +
[[Category:ReNamer]]

Latest revision as of 03:00, 1 April 2022

Serialize Rule

SerializeRule.png

This rule works on a set of files, and inserts incremental numeric series of digits in the names of those filenames.

The files listed in the pane can be numbered in increasing or decreasing order, with various steps, repeat and reset configuration. The position of each file in the Files pane becomes important, so check the order of the files in the list before applying this rule.

Examples:

  1. You have a bunch of log files, and you want to make them look like "log0001", "log0002", "log0003", etc.
  2. You want to force specific sorting for files: "01 - Song XYZ", "02 - Song ABC", "03 - Song YYY", etc.

The parameters are as follows:

Parameter Description
Index start Starting number. For example, if the destination folder already has some files with serialized numbers, you can start with the next number.
Step Increment the index by this value after each processed file. Usually 1, but you may like to enter a higher number here if files with intermediate numbers are expected later. Also, negative numbers can be used to make decremental indexes, e.g. -1, -2, -3, etc.
Repeat How many times to repeat (reuse) the same index before incrementing it.
Reset every Reset index to the initial value after processing this many files.
Reset if folder changes Since ReNamer can work on files collected from multiple folders, this control allows you to reset the counter for each of those folders. The effect is as if you are repeating the same command for each of the folders separately.
Reset if file name changes Reset the counter when the file name changes. This option is especially useful for fixing (serializing) duplicated file names, when the files with the same name are grouped together, which can be achieved by sorting the files by name or path.
Pad with zeros to length Pad the inserted number with leading zeros. For example, "457" becomes "000457" if it is padded to reach 6 digits, and "0457" if padded to 4 digits.
Insert where Specify where to insert the number (see below for individual options).

Insert location

Options for where to insert the number:

Option Description
Prefix Before the original filename
Suffix After the original filename
Position Insert the number at the specified position.
Replace current name Inserted number replaces the entire filename.
Skip extension Exclude file extension when calculating the position for insertion.

Numbering system

A choice of the Numbering system dictates which symbols and enumeration technique are used for the serialization.

Number system Description / Examples
Decimal digits Index starts at 0 with repeat 1 and step 1:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, …

English letters Index starts at 1 with repeat 1 and step 1:

a, b, c, …, x, y, z, ba, bb, bc, …, bx, by, bz, ca, cb, cc, …, zx, zy, zz, baa, bab, bac, …

Index starts at 1 with repeat 1 and step 1, pad to length 3:
aaa, aab, aac, …, aax, aay, aaz, aba, abb, abc, …, abx, aby, abz, aca, acb, acc, …, azx, azy, azz, baa, bab, bac, …

Roman numerals Index starts at 1 with repeat 1 and step 1:

I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, …

Music notes Index starts at 1 with repeat 1 and step 1:

C0, C#0, D0, D#0, E0, F0, F#0, G0, G#0, A0, A#0, B0, C1, C#1, …
Added in ReNamer 7.3.0.2 Beta.

Simplified Chinese Index starts at 1 with repeat 1 and step 1:

一, 二, 三, 四, 五, 六, 七, 八, 九, 一十, 一十一, 一十二, 一十三, …

Custom alphabetic Index starts at 1 with repeat 1 and step 1, using "ABC" symbols:

A, B, C, BA, BB, BC, CA, CB, CC, BAA, BAB, BAC, BBA, …

Index starts at 1 with repeat 1 and step 1, using "01" symbols:
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, …

Custom numeric Index starts at 0 with repeat 1 and step 1, using "ABC" symbols:

A, B, C, BA, BB, BC, CA, CB, CC, BAA, BAB, BAC, BBA, …

Index starts at 0 with repeat 1 and step 1, using "01" symbols:
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, …