help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to rename files to numbers in Eshell?


From: tomas
Subject: Re: How to rename files to numbers in Eshell?
Date: Tue, 14 Sep 2021 11:32:08 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Sep 14, 2021 at 12:17:33PM +0300, Jean Louis wrote:
> * Felix E. Klee <felix.klee@inka.de> [2021-09-14 10:43]:
> >  3. M-x query-replace-regexp
> > 
> >         [^ ]+jpg → \,(1+ \#).jpg

[...]

> Thanks for example.
> 
> Though it would be good to have the zero padding for cases when there
> are more files than 9 to later easier sort them.

Any lisp code can go between the parentheses in \,(...) so you might
try \,(format "%03d" \#)

(Caveat: I can't test it currently).

It's all described in the Emacs Manual "Regexp Replacement" chapter.

Cheers
 - t

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]