From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: reader@newsguy.com Newsgroups: gmane.emacs.help Subject: Re: Easy way to rename files sequentially? Date: Sun, 25 Nov 2007 17:34:28 -0600 Organization: Still searching... Message-ID: <87prxxrjaz.fsf@newsguy.com> References: <87ejeexgfy.fsf@celephais.home.net> <8CE7C98F-DF7F-44C9-87F4-98AA38B79C08@Web.DE> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1196033722 30856 80.91.229.12 (25 Nov 2007 23:35:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2007 23:35:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 26 00:35:29 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 1IwR0Z-00086i-JG for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Nov 2007 00:35:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwR0K-00046x-Nx for geh-help-gnu-emacs@m.gmane.org; Sun, 25 Nov 2007 18:35:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IwR03-00044q-7v for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 18:34:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IwR02-00043N-HU for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 18:34:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwR02-000434-B5 for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 18:34:54 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IwR02-00070W-Ad for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 18:34:54 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IwQzu-0008DO-GK for help-gnu-emacs@gnu.org; Sun, 25 Nov 2007 23:34:46 +0000 Original-Received: from adsl-76-224-105-8.dsl.emhril.sbcglobal.net ([76.224.105.8]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Nov 2007 23:34:46 +0000 Original-Received: from reader by adsl-76-224-105-8.dsl.emhril.sbcglobal.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Nov 2007 23:34:46 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: adsl-76-224-105-8.dsl.emhril.sbcglobal.net User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:vYhDm7ausw11EUFRY0XimQPtyQY= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:49528 Archived-At: Peter Dyballa writes: > Maybe in your case this works: > > M-x replace-regexp RET ^.*$ RET \,(format "%03d%s" \# \&) RET > > i.e. use the complete original file name (\&) and prepend it by a > zeroes padded three digit number (\# = number of already completed > replacements, i.e. starting with 0). The format specification can of > course contain additional text. But: dired does not understand \, nor > \# in its regular expressions – or I am missing something! How can this possibly do what the OP has asked about? It fails in my case but you seem to have known that \. or \# wouldn't work in dired. dired-string-replace-match: Invalid use of `\' in replacement text So I guess I'm missing what the utility of your post was meant to be.