From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Easy way to rename files sequentially? Date: Sun, 25 Nov 2007 23:12:35 +0200 Message-ID: References: <87ejeexgfy.fsf@celephais.home.net> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1196025194 5785 80.91.229.12 (25 Nov 2007 21:13:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2007 21:13:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 25 22:13:21 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IwOmr-0002O4-Ny for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2007 22:13:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwOmc-0000YJ-KP for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2007 16:12:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IwOmO-0000YD-RH for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 16:12:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IwOmN-0000Xv-A6 for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 16:12:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwOmN-0000Xm-6v for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 16:12:39 -0500 Original-Received: from nitzan.inter.net.il ([213.8.233.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IwOmN-0004tr-0y for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 16:12:39 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-83-130-236-63.inter.net.il [83.130.236.63]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id IKJ45248 (AUTH halo1); Sun, 25 Nov 2007 23:10:01 +0200 (IST) In-reply-to: <87ejeexgfy.fsf@celephais.home.net> (message from cothrige on Sun, 25 Nov 2007 13:39:45 -0600) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49516 Archived-At: > From: cothrige > Date: Sun, 25 Nov 2007 13:39:45 -0600 > > > 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. But it seems there must be a better way to > rename a list of files and sequentially number them. Is there some > relatively easy way to add such a numerical prefix to a list of files? Try the "% R" command in Dired. It computes the new name by regular-expression substitution from the old name.