microsoft/PowerToys

[PowerRename] Bulk regex rename needs to include folders

Open

#1,391 opened on Feb 27, 2020

View on GitHub
 (10 comments) (4 reactions) (0 assignees)C# (7,978 forks)batch import
Help WantedIdea-EnhancementProduct-PowerRename

Repository metrics

Stars
 (133,154 stars)
PR merge metrics
 (Avg merge 14d 20h) (117 merged PRs in 30d)

Description

I read that this utility would allow renaming multiple files with regular expressions. There was a checkbox to exclude folders, so I thought if I unchecked that it would include folders. Apparently my expectation of "include folders" doesn't match how the utility works.

I have a lot of files in the form:

  • 2019\02\05\foo.html
  • 2020\04\03\bar.html

I want to rename them to the form:

  • @2019-02-05-foo.html
  • @2020-04-03-bar.html

I figured I would match some regex (\d\d\d\d)\\(\d\d)\\(\d\d)\\(.+)\.html and rename that to @$1-$2-$3-$4.html. It seemed straightforward to me. Looks like the utility can't handle it, though; apparently it only looks at the filename.

You might make this shortcoming explicit in the documentation.

Contributor guide