Fork me on GitHub
#emacs
<
2022-03-17
>
winsome01:03:46

What's the best way to rename a bunch of files? I can get an occur buffer via projectile-find-file, and I can edit it, but when I try to save it just prompts me for a file to save the changes in, instead of renaming all the files.

1
winsome01:03:13

I've now spent way more time than it would take to manually do them one by one, but I'm determined to do it the emacs way :p

Cora (she/her)01:03:58

that's just in one directory, though

Cora (she/her)01:03:47

this feels like a problem best solved in a shell, to me, though

winsome04:03:56

Yeah, I may have to - my files are not in the same directory. Thanks for the link, though, dired is great!

ag18:03:05

you can use find-name-dired and then use the wdired mode to rename files.

winsome19:03:26

That worked! Thanks

👍 1
teodorlu06:03:01

Please do report back if you figure it out - I'm curious! If you revert to Unix tools, "find ... -exec ..." might work. https://unix.stackexchange.com/questions/227662/how-to-rename-multiple-files-using-find

mpenet08:03:07

you can do that via embark

mpenet08:03:33

use some command to list all the files you're interested in (consult find file, project.el/projectile find file, etc) , embark-export, edit dired buffer that contains your filtered results (via wdired-change-to-wdired-mode), save and done

👀 1