all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Easy way to rename files sequentially?
Date: Sun, 25 Nov 2007 23:11:15 +0000	[thread overview]
Message-ID: <87ve7p6hv0.fsf@bzg.ath.cx> (raw)
In-Reply-To: <87ejeexgfy.fsf@celephais.home.net> (cothrige@yahoo.com's message of "Sun, 25 Nov 2007 13:39:45 -0600")

cothrige <cothrige@yahoo.com> writes:

> I sometimes have a list of files which I would like to rename both in
> a group and in sequence.  In the past, for very long lists of files
> with a number in the name, e.g. "some random audio file ep 01 of
> 200.mp3", I would use thunar as it will very easily and automatically
> add a sequential number to the front of the names, resulting in
> 01-xxx.mp3 and so on.  Of course, there are many reasons I would
> rather not have to use thunar, and would prefer to be able to do it
> from within emacs.  I have managed to do this a few times using wdired
> and a keyboard macro, and this really isn't too bad.

Yes, this isn't that bad at all (considered the number of times I need
to renumber files sequentially -- but you might have other needs.)

Here is how I do it (for those interested):

0. (wdired-change-to-wdired-mode) [which I bind to C-c C-c]
1. <F3> (kmacro-start-macro-or-insert-counter)
2. Put the point where to add the number in the file
3. <F3> again to insert the counter value
4. Put the point where to add the number in the next file
5. <F4> to save the macro

C-e e e e e ... does the job for me.

-- 
Bastien

  parent reply	other threads:[~2007-11-25 23:11 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-25 19:39 Easy way to rename files sequentially? cothrige
2007-11-25 20:35 ` Sven Bretfeld
2007-11-25 21:12 ` Eli Zaretskii
2007-11-25 21:46   ` reader
2007-11-26  3:39     ` Eli Zaretskii
2007-11-26  7:33       ` reader
2007-11-26 12:49         ` David Hansen
2007-11-26 17:56           ` reader
2007-11-26 18:26             ` David Hansen
2007-11-26 20:40               ` Eli Zaretskii
     [not found]               ` <mailman.4145.1196109649.18990.help-gnu-emacs@gnu.org>
2007-11-26 21:00                 ` David Kastrup
2007-11-26 20:08             ` Thierry Volpiatto
2007-11-27  7:07               ` Sebastian Tennant
2007-11-27  7:18                 ` Thierry Volpiatto
2007-11-27 15:14                 ` Thierry Volpiatto
2007-11-27 15:20                   ` Sebastian Tennant
2007-11-26 20:03         ` Eli Zaretskii
2007-11-27 19:31           ` reader
     [not found]           ` <mailman.4195.1196192427.18990.help-gnu-emacs@gnu.org>
2007-11-27 20:12             ` Joel J. Adamson
2007-11-27 21:35               ` Thierry Volpiatto
2007-11-27 22:00                 ` Joel J. Adamson
     [not found]                 ` <mailman.4203.1196200844.18990.help-gnu-emacs@gnu.org>
2007-11-27 23:40                   ` Johan Bockgård
2007-11-27 23:43                   ` David Kastrup
2007-11-28 15:27                     ` Joel J. Adamson
     [not found]         ` <mailman.4117.1196081659.18990.help-gnu-emacs@gnu.org>
2007-11-28  4:17           ` cothrige
2007-11-28  6:43             ` Thierry Volpiatto
2007-11-28 14:27             ` Ted Zlatanov
2007-11-28 15:35             ` Joel J. Adamson
2007-11-28 17:18               ` cothrige
2007-11-28 21:20                 ` cothrige
     [not found]       ` <mailman.4107.1196062436.18990.help-gnu-emacs@gnu.org>
2007-11-28  3:48         ` cothrige
2007-11-25 21:19 ` Xah Lee
2007-11-25 22:40   ` reader
2007-11-25 23:16     ` Peter Dyballa
2007-11-25 23:50       ` reader
2007-11-26  9:20         ` Peter Dyballa
2007-11-26 18:11           ` reader
2007-11-26 22:23             ` Peter Dyballa
2007-11-27 19:28               ` reader
2007-11-25 21:51 ` Peter Dyballa
2007-11-25 23:34   ` reader
2007-11-25 23:11 ` Bastien [this message]
     [not found] ` <mailman.4087.1196027477.18990.help-gnu-emacs@gnu.org>
2007-11-28  3:36   ` cothrige
     [not found] ` <mailman.4081.1196022933.18990.help-gnu-emacs@gnu.org>
2007-11-29  3:29   ` cothrige

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ve7p6hv0.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.