Re: Renaming files with rename and perl expression

2011-10-06 Thread Brad Rogers
On Thu, 06 Oct 2011 10:57:51 -0300 Eduardo M KALINOWSKI wrote: Hello Eduardo, > That looses the trailing zeroes. Try this: ITYM leading. -- Regards _ / ) "The blindingly obvious is / _)radnever immediately apparent" Walking through town is quite scary I Pr

Re: Renaming files with rename and perl expression

2011-10-06 Thread Mike McClain
On Thu, Oct 06, 2011 at 03:35:48PM +0200, Csanyi Pal wrote: > Hi, > > Where can I study perl expressions? subscribe to beginn...@perl.org mailing list. perldoc perlre perldoc perlretut Happing perling, Mike -- Satisfied user of Linux since 1997. O< ascii ribbon campaign - stop html mail - www

Re: Renaming files with rename and perl expression

2011-10-06 Thread Csanyi Pal
Eduardo M KALINOWSKI writes: > On 10/06/2011 10:54 AM, Eduardo M KALINOWSKI wrote: >> >> Something like >> >> rename -n 's/(\d+)/$1+198/e' *.JPG >> >> should do the trick, but note that it might match other files. > > That looses the trailing zeroes. Try this: > > rename -n 's/(\d+)/sprintf("%05d

Re: Renaming files with rename and perl expression

2011-10-06 Thread Darac Marjal
On Thu, Oct 06, 2011 at 03:35:48PM +0200, Csanyi Pal wrote: > Hi, > > I have a directory with filenames as follows: > [cut] I think what you need is something a little more than just s///. rename will take any perl expression, which, as the man page says, is expected to rename $_ (which is a per

Re: Renaming files with rename and perl expression

2011-10-06 Thread Eduardo M KALINOWSKI
On 10/06/2011 10:54 AM, Eduardo M KALINOWSKI wrote: > > Something like > > rename -n 's/(\d+)/$1+198/e' *.JPG > > should do the trick, but note that it might match other files. That looses the trailing zeroes. Try this: rename -n 's/(\d+)/sprintf("%05d", $1+198)/e' *.JPG -- poverty, n.:

Re: Renaming files with rename and perl expression

2011-10-06 Thread Eduardo M KALINOWSKI
On 10/06/2011 10:35 AM, Csanyi Pal wrote: > Hi, > > I have a directory with filenames as follows: > > PIC1.JPG > PIC2.JPG > .. > PIC00036.JPG > > I want to get renamed those to > PIC00199.JPG > PIC00200.JPG > .. > PIC00234.JPG > > I'm trying to use for this the 'rename' command with perl

Renaming files with rename and perl expression

2011-10-06 Thread Csanyi Pal
Hi, I have a directory with filenames as follows: PIC1.JPG PIC2.JPG .. PIC00036.JPG I want to get renamed those to PIC00199.JPG PIC00200.JPG .. PIC00234.JPG I'm trying to use for this the 'rename' command with perl expression, but sofar I'm here with the command: rename -n 's/PIC000..

Re: emacs: renaming files in a programming project

2008-06-27 Thread Cédric Lucantis
Le Friday 27 June 2008 19:20:41 H.S., vous avez écrit : > Hello, > > I have a directory with a whole bunch of source files (C++ files, *.cpp > and *.hpp). I am at a position where I need to rename a subset of those > source files (their functionality has changed over the time and hence > the need f

emacs: renaming files in a programming project

2008-06-27 Thread H.S.
Hello, I have a directory with a whole bunch of source files (C++ files, *.cpp and *.hpp). I am at a position where I need to rename a subset of those source files (their functionality has changed over the time and hence the need for new intuitive names). Now, I am going to do this the basic

Re: Renaming files

2003-01-05 Thread Gerald Livingston
On Sun, 5 Jan 2003 21:57:45 -0600 will trillich <[EMAIL PROTECTED]> wrote: > On Sun, Jan 05, 2003 at 01:19:59AM -0600, Gerald V. Livingston II > wrote: > > The script:cat ~/bin/names > > > > #!/bin/bash > > > > typeset -i a=1 > > > how about > > ls /t/*.jpg /t/*.JPG /t/*.jpeg 2>/dev/null

Re: Renaming files

2003-01-05 Thread will trillich
On Sun, Jan 05, 2003 at 01:19:59AM -0600, Gerald V. Livingston II wrote: > The script:cat ~/bin/names > > #!/bin/bash > > typeset -i a=1 > > if [ `ls /t/*.jpg 2>/dev/null|wc -l` -gt 0 ] > then for i in /t/*.jpg; >do mmv "$i" /t/`date +%s`-$a.jpg; a=a+1; done > if [ `ls /t/*.JPG 2>/dev/nul

Renaming files

2003-01-04 Thread Gerald V. Livingston II
n that old thread about renaming files I didn't specify WHY I wanted to do it. It's from a thread I started in the procmail-users list. Thanks for all the various ideas. I'm staying with the for-loop for simplicity's sake and because this will never see that many files. What

Re: renaming files

2001-01-28 Thread Moritz Schulte
brian moore <[EMAIL PROTECTED]> writes: > > for name in *.mp3; do > > newname=$(echo "$name" | sed -e 's/[ "\(\),]//g') > > echo "Moving \"$name\" to \"$newname\"" > > mv -i "$name" "$newname" > > done > > Oh, goodness, that looks complex. > > % rename 's/[ ,"()]/_/g' *.mp3 Why do it the

Re: renaming files

2001-01-28 Thread brian moore
On Sat, Jan 27, 2001 at 12:12:53PM +0100, Moritz Schulte wrote: > "oj ." <[EMAIL PROTECTED]> writes: > > > I have a bunch of files (*.mp3) that have spaces and characteres > > such as: ", ( ,_. I would like to remove all the spaces and > > characteres and leave them as: xshkjds_jskdjks_jsdj.mp3. >

Re: renaming files

2001-01-27 Thread Moritz Schulte
"oj ." <[EMAIL PROTECTED]> writes: > I have a bunch of files (*.mp3) that have spaces and characteres > such as: ", ( ,_. I would like to remove all the spaces and > characteres and leave them as: xshkjds_jskdjks_jsdj.mp3. for name in *.mp3; do newname=$(echo "$name" | sed -e 's/[ "\(\),]//g')

renaming files

2001-01-27 Thread oj .
I have a bunch of files (*.mp3) that have spaces and characteres such as: ", ( ,_. I would like to remove all the spaces and characteres and leave them as: xshkjds_jskdjks_jsdj.mp3. Do you know how can I do that using scripts? ThanksGet your FREE download of MSN Explorer at http://explorer.msn.com

Re: script doesn't work (renaming files)

2000-09-19 Thread Oliver Elphick
Lars Grobe wrote: >Hi there, > >I have to rename a lot of files containing special >characters. I've got a script to do that, but it >doesn't work here (unexpected end of file etc..). > >BTW: How do I get a list of files containing some >special characters (äÄöÖüÜß)? Will the "find"

script doesn't work (renaming files)

2000-09-19 Thread Lars Grobe
Hi there, I have to rename a lot of files containing special characters. I've got a script to do that, but it doesn't work here (unexpected end of file etc..). BTW: How do I get a list of files containing some special characters (äÄöÖüÜß)? Will the "find" do this job? Thank You, CU, Lars. -- S