s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal <csanyi...@gmail.com> wrote: > Hi, > > my goal is to get in a directory the following: > > PIC00001.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg > PIC00002.JPG renamed as Gyermekolimpia_Ujvidek_002.jpg > ... > PIC00223.JPG renamed as Gyermekolimpia_Ujvidek_223.jpg > > > So far I get this to work: > > rename -n 's/\w\w\w\w\w/sprintf("Gyermekolimpia_Ujvidek_")/e' *.JPG > PIC00001.JPG renamed as Gyermekolimpia_Ujvidek_110.JPG > etc. > PIC00223.JPG renamed as Gyermekolimpia_Ujvidek_223.JPG > > This is good but I want to make the .JPG extensions lowercase. > > I know that the following command do this: > rename -v 's/\.JPG$/\.jpg/' *.JPG > > but I want to know how to add > \.JPG$/\.jpg/ > > into the following command? > rename -n 's/\w\w\w\w\w/sprintf("Gyermekolimpia_Ujvidek_")/e' *.JPG > > -- > Regards, Pal > <http://cspl.me> > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > >
-- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/