PowerToys
PowerToys copied to clipboard
[PowerRename] improved enumeration / incremental counter
Summary of the new feature/enhancement
- Some way of automatically renaming with an increasing counter but located in a user-defined location and initial value.
Example: imported images from a camera are named
IMG_3156 -> IMG_3259
in sequential order.
And I would like to rename them
RomanticFailure_040_TopSecret -> RomanticFailure_143_TopSecret
Right now (0.18) there doesn't seem to be a way to do this (unless it is possible by massaging RegEx sufficiently, but I am too unfamiliar, in which case some documentation would be v helpful). There is the enumerate items option, but it just seems to always add a sequential counter starting from 1 and appended as (#)
Proposed technical implementation details (optional)
I guess it would be good if there were some sort of variable, e.g. $COUNTER, which would contain the number of the file being process and that could be inserted in an arbitrary place in the Replace with field.
It would be helpful if simple mathematical operation could be applied to it, e.g.
(2*$counter+5)
would actually produce a sequence of files named 5, 7,9,11,13.
I suppose some way to specify padded zeros, or a number format would be good, so that we would get 05, 07, 11, 13.
Crutkas: this should able to be included not just at the end, but anywhere in the string
Even a simple counter that is applied optionally as a suffix or prefix based on the current name sort order would be handy (although a datetime ordering option would also be useful).
My current workaround is to select all files in File Explorer, rename the first file with an arbitrary placeholder name, such as "item", then use PowerRename in two passes to clean up the mess.
So, renaming all selected files as "item" in File Explorer results in files being renamed as "item (1)", "item (2), "item (3)", etc, (in the same order as they were alphabetically sorted, which is handy if they were previously numerically sequenced then culled and you want to renumber them to eliminate gaps).
PowerRename is then used in a first pass to replace "item (" with "", then in a second pass to replace ")" with "", so that the files end up being named "1", "2", "3", etc. Or to build a sequence based on a date, where instead of "item" I would use, say "20200501_", but then there is still the problem of having to manually add leading zeros to some filenames if you want all to be the same length.
You have to take care because PowerRename will rename files with leading or trailing spaces if you mistake a space character for "" in the dialog! This leads to other applications being upset (File Explorer has trouble renaming them).
from https://github.com/microsoft/PowerToys/issues/5833#issue-676137941
It is essential to be able to use incrementing numbers for file renaming. You already have the Enumerate Item option, but it is limited and sometimes not suitable. For example what if i wanted my counter start at 15, or i don't want the encapsulating round brackets.
Please consider implementing the Regular Expression Counter Operations: https://www.funduc.com/regexp.htm#Regular%20Expression%20Counters http://searchandreplace.helpmax.net/en/regular-expressions/regular-expression-counters/
It is in the format %1>15> (which substitutes $1) and means: use the first match in the expression and increment each match starting with number 15. If no starting value is given %1>> would use the starting value of the first match found.
from #7402 (comment)
In addition a feature like on linux where I can create filenames with counted nunbers and character would be great.
Example
Terminal command
touch Image{A..C}{0..9}.jpg
Created Files
ImageA0.jpg, ImageA1.jpg, ..., ImageA9.jpg, ImageB0.jpg, ..., ImageB9.jpg, ..., ImageC9.jpg
The Enumerate Items
option is too limited. This doesn't work for naming conventions with unique formatting requirements. What if we need leading 0s? What if we need the enumeration to be 0-indexed?
Something that would work well as an alternative would be adding a custom variable pattern. This variable pattern could use 0 or 1 to change the indexing, and the number of characters for the number of leading zeroes required.
For example:
$0 ---> [0, 1, 2, ..]
$00 --> [00, 01, 02, ..]
$000 -> [000, 001, 002, ..]
$1 ---> [1, 2, 3, ..]
$11 --> [01, 02, 03, ..]
$111 -> [001, 002, 003, ..]
As it stands, the current Enumerate Items
feature is to limited to use in any kind of development environment.
Does anyone even like seeing their files enumerated with parentheses? 😅
All selected Items should be able to have a prefix applied ( easily without knowledge of codes or symbols) and renumbered with padding without any special knowledge.
any progress on this? honestly, current numbering system isn't very useful
adding an element like the current date system would be OK, something like $ddd (each d represents a digit). Shouldn't create conflict as the day of the week is represented by capital D
@ghylander Sadly, not yet. This issue does welcome all community pull requests. Feel free to contribute to this if anyone is able to. Just make sure to let us know here and follow our contributing guidelines! 😄
Here's a great idea - someone should write a spellchecker that doesn't show you the correct spelling. How about a weather app that doesn't include the temperature? I know... DAW without a record button! Or perhaps an bulk renamer that doesn't have useful enumeration?
Here's a great idea - someone should write a spellchecker that doesn't show you the correct spelling. How about a weather app that doesn't include the temperature? I know... DAW without a record button! Or perhaps an bulk renamer that doesn't have useful enumeration?
I actually really like the spellchecker idea! Force the user to LEARN how to spell. 😆
Let's Kickstart this ASAP! 🤩🤩🤩
I would love to see some more enumation options in PowerRename. Can we expect this in the near future? Would be great. Unfortunately I am not able to create a pull request.
Would really love this feature. Was literally the only reason I downloaded PowerToys because I thought I could number a bunch of files.
Would really love this feature. Was literally the only reason I downloaded PowerToys because I thought I could number a bunch of files.
This is the one I use instead: http://www.den4b.com/products/renamer It may take you 15mins to learn how to use it, but once you've got the hang of it, it's pretty easy. Free version is fine for anything I usually need to do.
Please add this functionality!
Also I think this could be simplified. Advanced renamer does a great job of this.
These could be added as 'quick tokens' just like the date and time variables that are already implemented into PowerRenamer at the minute so that you don't have to figure out the regEx everytime just to rename a few hundred files.
Advanced renamer does it in a nice way. See image below
Also, Global Renamer (an After Effects plugin from AeScripts) does a nice job too
Providing the index as a variable in the Replace
field would be a really great approach to making everyone happy here, I think!
The current Enumeration option is completely useless, please do this cmon
The ability to use, say, letters in place of numbers would also be fantastic (especially for people like me who have workflows that use letters for animation frame identifiers).
Just came across this looking for this exact feature, definitely a needed one! For now guess I need to find another tool for this.
A little work around I've found is by renaming twice using RegExp. First add the required amount of prefix zeros, then remove them using RegExp
First iteration
file-(\d+)\.png
-> file-00$1.png
Second iteration
file-(\d+)(\d{3})\.png
-> file-$2.png
(only keep the 3 digits in the second group)
Can I work on implementing this feature?
@kokabi1365 Sure. You can create a PR. Feel free to ask for help if needed.
I think an easy syntax like I suggest in my comment above would be great: https://github.com/microsoft/PowerToys/issues/3814#issuecomment-776666200
Or something like suggested here:
- https://github.com/microsoft/PowerToys/issues/7402#issuecomment-731843574
- https://github.com/microsoft/PowerToys/issues/3814#issuecomment-1149590911
cc: @crutkas , @jaimecbernardo
@htcfreek Excuse me . Today, when I wanted to work on this issue I realized that it's written in C++. So, I have to work on some other issues that are related to c#.
Any progress on this topic? Is it possible with the current version to simply increment the value of number by one? I.e. img_1.jpg - img_216.jpg to img_2.jpg - img_217.jpg
Seriously can we please get this added. Enumerating by a count variable is the most used feature of any renaming tool. Please. Its been over two years since this initial feature has been requested. What gives.
Found this thread after using PowerRename for the first time. I thought this was one of the most default features for batch renaming. It'd be great to see this added.
Mind blown by knowing that this isn't a feature. I feel like this is the most fundamental requirement of batch-renaming.
Came here looking for this feature too +10000
+1, really want to be able to enumerate files without the () and have whatever leading zeroes I like, starting from any number I want.
I'm looking for exactly this feature
@chrdavis @dedavis6797 @crutkas
Can we get an indication if this is on your radar at all?
It is a huge glaring missing feature to not be able to enumerate / incremental counter for files.
powerrename is pretty great but without enumeration features it is useless in a lot of cases, +1