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: Mon, 26 Nov 2007 22:03:49 +0200 Message-ID: References: <87ejeexgfy.fsf@celephais.home.net> <871waeroap.fsf@newsguy.com> <8763zpwje7.fsf@newsguy.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1196107457 20000 80.91.229.12 (26 Nov 2007 20:04:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Nov 2007 20:04:17 +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 21:04:24 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 1IwkBr-0000UL-GZ for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Nov 2007 21:04:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwkBc-0005IM-JX for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Nov 2007 15:04:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IwkBN-0005Hy-TI for help-gnu-emacs@gnu.org; Mon, 26 Nov 2007 15:03:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IwkBM-0005HO-91 for help-gnu-emacs@gnu.org; Mon, 26 Nov 2007 15:03:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwkBM-0005HL-3V for help-gnu-emacs@gnu.org; Mon, 26 Nov 2007 15:03:52 -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 1IwkBL-0002nc-Gx for help-gnu-emacs@gnu.org; Mon, 26 Nov 2007 15:03:51 -0500 Original-Received: from HOME-C4E4A596F7 ([81.5.42.135]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id IKP12308 (AUTH halo1); Mon, 26 Nov 2007 22:01:13 +0200 (IST) In-reply-to: <8763zpwje7.fsf@newsguy.com> (reader@newsguy.com) 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:49555 Archived-At: > From: reader@newsguy.com > Date: Mon, 26 Nov 2007 01:33:36 -0600 > > So something like: > > img-0987.jpg > img-9027.jpg > img-1237.jpg > img-0007.jpg > > Might become: > > 000-img-0987.jpg > 001-img-9027.jpg > 002-img-1237.jpg > 003-img-0007.jpg > > Or if keeping the original for reference is not needed then possibly: > > img-000.jpg > img-001.jpg > img-002.jpg > img-003.jpg You should be able to use the \, construct to invoke `format' or some similar function and advance the counter. See the example in (emacs) Regexp Replace in the Emacs manual.