PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

[PowerRename] improved enumeration / incremental counter

Open wigster opened this issue 4 years ago • 36 comments

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

wigster avatar May 28 '20 10:05 wigster

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).

PaulCoddington avatar Jun 14 '20 06:06 PaulCoddington

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.

enricogior avatar Feb 09 '21 01:02 enricogior

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

htcfreek avatar Feb 10 '21 12:02 htcfreek

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? 😅

tonycoculuzzi avatar Sep 16 '21 21:09 tonycoculuzzi

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.

chuzzbot avatar Nov 04 '21 05:11 chuzzbot

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 avatar Jan 14 '22 13:01 ghylander

@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! 😄

franky920920 avatar Jan 17 '22 14:01 franky920920

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?

Chianti avatar Feb 05 '22 12:02 Chianti

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! 🤩🤩🤩

PwrSrg avatar Feb 05 '22 14:02 PwrSrg

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.

jjnxpct avatar Apr 22 '22 16:04 jjnxpct

Would really love this feature. Was literally the only reason I downloaded PowerToys because I thought I could number a bunch of files.

ThisTemba avatar May 19 '22 15:05 ThisTemba

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.

Chianti avatar May 19 '22 16:05 Chianti

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

image

Also, Global Renamer (an After Effects plugin from AeScripts) does a nice job too image

jameslashmar avatar Jun 08 '22 08:06 jameslashmar

Providing the index as a variable in the Replace field would be a really great approach to making everyone happy here, I think!

RyKilleen avatar Jun 18 '22 21:06 RyKilleen

The current Enumeration option is completely useless, please do this cmon

Fabiwolter avatar Jul 22 '22 22:07 Fabiwolter

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).

Derpford avatar Aug 14 '22 20:08 Derpford

Just came across this looking for this exact feature, definitely a needed one! For now guess I need to find another tool for this.

Snowdrama avatar Aug 29 '22 10:08 Snowdrama

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)

locomoco28 avatar Aug 29 '22 13:08 locomoco28

Can I work on implementing this feature?

ghost avatar Sep 27 '22 19:09 ghost

@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 avatar Sep 27 '22 20:09 htcfreek

@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#.

ghost avatar Sep 30 '22 19:09 ghost

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

WouterVanGoey avatar Oct 03 '22 14:10 WouterVanGoey

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.

polygonfuture avatar Nov 19 '22 22:11 polygonfuture

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.

Frioo avatar Nov 21 '22 22:11 Frioo

Mind blown by knowing that this isn't a feature. I feel like this is the most fundamental requirement of batch-renaming.

m4heshd avatar Dec 05 '22 04:12 m4heshd

Came here looking for this feature too +10000

oooseun avatar Dec 10 '22 23:12 oooseun

+1, really want to be able to enumerate files without the () and have whatever leading zeroes I like, starting from any number I want.

dragonshardz avatar Dec 24 '22 00:12 dragonshardz

I'm looking for exactly this feature

scwall avatar Dec 30 '22 12:12 scwall

@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.

polygonfuture avatar Jan 06 '23 00:01 polygonfuture

powerrename is pretty great but without enumeration features it is useless in a lot of cases, +1

mbazaczek avatar Jan 26 '23 12:01 mbazaczek