Rearrange file names in Emacs

dired, emacs, file-rename, windows

Solution

You can use M-x wdired-change-to-wdired-mode to make a dired buffer editable. Afterwards a simple keyboard macro with a counter, starting from the end of the dired buffer, should do the trick for you.

If you don't want to use a macro an alternative would be:

M-x replace-regexp
Replace regexp: ^[0-9]+
Replace regexp with \,(- 99 \#&)

Problem

I have a batch of files with the same format say `bmp`, the file name is `0.bmp` `1.bmp` ... `99.bmp`, I want to change the file names, say `0.bmp` to `99.bmp`, `1.bmp` to `98.bmp` etc. can emacs do this in `dired-mode`? I use emacs under Windows.

Original source

Related problems