stefankueng / grepWin

A powerful and fast search tool using regular expressions
https://tools.stefankueng.com/grepWin.html
GNU General Public License v3.0
1.74k stars 180 forks source link

Can you add a feature to change file names? #282

Open theairbud opened 3 years ago

theairbud commented 3 years ago

I love that you can bulk rename the contents of files, but can you also add a feature to be able to bulk rename the file names themselves? Thank you!

WebMechanic commented 2 years ago

Best Tool for that job "Flexible Renamer", am using this for years.

UNICODE file/folder renaming utility, which can use Wildcard or Regular-Expression, Tag-information (MP3, EXIF) and script (vbs/js). https://hp.vector.co.jp/authors/VA014830/english/FlexRena/

It's a bit dated but works fine on Win10/x64. Just give it a go.

kirkw commented 2 years ago

I do this quickly enough. Find everything SELECT ALL the items [In File View] (Copy FileNames)

paste into NotePad++ from first column, Shift+ALT+{DOWN} For all of the first lines, type "REN " (it appears in front of every line, ignore quotes)

Use same technique on the other file (buffer), after renaming with search/replace.

Copy using the same technique (column copy). And paste paste the end of the longest line position, on line 1

I usually paste ONE line into a CMD window. If it works, I replace the rest!

Sidenote. What if the filenames need to be Quoted... Easiest way. Create enough blank lines at the top of the file. Use the Alt+Shift+{DOWN} to be at the front, and type "" (you get a quote quote on each line).

Now go down and SELECT the filenames below using that same ALT+SHIFT technique. Go to the furthest end to get everything.

Go up in between the first two Quotes... And paste. It should paste it WITHOUT extra spaces at the end. (Does for me).

Now, copy that somewhere else, and RENAME inside of the selection, for example. Now select using the Alt+Shift trick. And paste the end of the first line (really far out, not to hit one of the other lines)

That's the general trick.

The other technique I use is Excel. 2 Columns, and in 3rd column I create the RENAME command, using a formula that quotes the fields...

WebMechanic commented 2 years ago

sounds rather tedious to me :D I still highly recommend "Flexible Renamer", it's free and has many other ways to rename files and folders en masse, incl. a scripting interface so you can literally do anything based on the files and their (meta) data.